> Hi All, > still trying to update old code. Am I using $_SESSION properly? > > <snip> > if (mysql_num_rows($res) ==1){ > /* If correct start session*/ > session_start(); > $_SESSION['SESSION_UNAME']; > $SESSION_UNAME = $user; > > header("Location: welcome.php"); > mysql_free_result ($res); > </snip>
Nope. Just use $_SESSION['SESSION_UNAME'] = $user; You can treat $_SESSION just as you would any other array. $_SESSION['something'] = "whatever"; etc... Then, on any page with session_start(), you have the whole session array available to you, no matter what page the variable was initially created on. FYI: use unset($_SESSION['SESSION_UNAME']); to erase a session variable. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php