I can't display session variables
Posted: Wed Sep 03, 2008 7:53 pm
OK so I know the session array works because if i use print r, I see all data that has been passed to the new page. Now how do I access specific data in the array to place in specific parts of my html.
Here is the sessions array code:
Can someone enlighten me on how to display specific data from sessions array.
This:
does not work
Here is the sessions array code:
Code: Select all
$q = "SELECT * FROM `login` WHERE `username` = '".$_SESSION['login_username']."' AND `password` = '".$_SESSION['login_password']."'";
$q = mysql_query($q);
if(mysql_num_rows($q) == 0) {
$_SESSION = array();
} else {
$ar = mysql_fetch_array($q);
$_SESSION['login'] = $ar;
$this->LOGGEDIN = true;
$this->FAILED = false;This:
Code: Select all
<?php print " <b>".$ar['FName'] . "</b> ";?>