lintz
Feb 17th, 2005, 08:10 PM
Once a user logs in I create a global array variable to store all their info using the below.
$UserDetails = mysql_fetch_row($sSQL);
$GLOBALS['UserDetails'] = $UserDetails;
echo "Hello $UserDetails[0]"; //This displays the users name
The problem is when I use the below on another php page the variable is empty. I must be doing something that is simply to correct but I can't find it :confused:
global $UserDetails;
echo "Welcome $UserDetails[0]...."; //All that is displayed is Welcome ....
$UserDetails = mysql_fetch_row($sSQL);
$GLOBALS['UserDetails'] = $UserDetails;
echo "Hello $UserDetails[0]"; //This displays the users name
The problem is when I use the below on another php page the variable is empty. I must be doing something that is simply to correct but I can't find it :confused:
global $UserDetails;
echo "Welcome $UserDetails[0]...."; //All that is displayed is Welcome ....