note 25396 added to function.session-start

From: Date: Sat, 21 Sep 2002 22:46:25 +0000
Subject: note 25396 added to function.session-start
Groups: php.notes 
Request: Send a blank email to php-notes+get-37099@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, -- http://www.php.net/manual/en/function.session-start.php http://master.php.net/manage/user-notes.php?action=edit+25396 http://master.php.net/manage/user-notes.php?action=delete+25396 http://master.php.net/manage/user-notes.php?action=reject+25396

« previous php.notes (#37099) next »