RE: [PHP] Browser Redirect

From: Date: Thu, 24 Apr 2003 16:49:31 +0000
Subject: RE: [PHP] Browser Redirect
Groups: php.general 
Request: Send a blank email to php-general+get-145184@lists.php.net to get a copy of this message
> -----Original Message----- > From: Chris Cook [mailto:cjc1800@hotmail.com] > Sent: Tuesday, April 22, 2003 8:50 PM > To: php-general@lists.php.net > Subject: RE: [PHP] Browser Redirect > > > Thanks for the reply. I have the code just like you have it, > but on the page > that I register the session var, it is empty. > > //page1.php > session_start(); > $_SESSION['var'] = 'value'; > echo $_SESSION['var']//results in nothing There's nothing wrong with the code above, and it works fine for me. Are you sure you have the code like that, or do you have it in double quotes like: echo "$_SESSION['var']"//results in nothing If you have the code in double quotes, you need to help php a little at use curly braces around the array reference: echo "{$_SESSION['var']}" //results in value being echo'd

« previous php.general (#145184) next »