note 25396 rejected from function.session-start by nicos
| From: | nicos@php.net | Date: | Sun, 22 Sep 2002 00:12:13 +0000 |
| Subject: | note 25396 rejected from function.session-start by nicos | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-37101@lists.php.net to get a copy of this message | ||
Ok maybe its me but I can't seem to get session variables to work.
I am simply trying to register a username to be used across all of my php pages.
Code is as follows
session_start();
$username=$_POST['username'];
$_SESSION["g_username"]=$username;
I then want to reference the g_username variable on other pages. I am simply trying to access the
variable on subsequent pages like this.
session_start();
echo $g_username;
Is this the correct way to reference this session varibale or am I doing this wrong.
I am a ASP convert so please be gentle.
thanks,