Session problem

From: Date: Mon, 06 Aug 2001 20:23:57 +0000
Subject: Session problem
Groups: php.general 
Request: Send a blank email to php-general+get-61481@lists.php.net to get a copy of this message
PHP 4.0.2 .. I have a very basic script, gets the user's name, registers it, then displays "Welcome, $NAME." $NAME is the session registered name. If I constantly reload that page that says Welcome, sometimes $NAME appears, sometimes not. Completely random. It just loses track of the variable. My code: auth.php: session_start(); ... $res = mysql_query("SELECT NAME FROM dbhere where EMAIL = '$EMAIL' AND PASSWORD = '$PASSWORD'"); if ($row = mysql_fetch_array($res)) { $NAME = $row[NAME]; session_register("NAME"); } ... Header("Location: menu.php"); menu.php: session_start(); echo "Welcome, $NAME"; So like, what the hell. Why would it keep losing track of $NAME? Thanks, Chad

« previous php.general (#61481) next »