Problems with calling a variable in a php session?
May 11th, 2010
I am new to sessions and I have written a few php programs and want to make a session I have declared Session_start() at the begining then declares $_session=”yes”
if ($pword == $ROW[4])
$_session['login']=”yes”;
else
die (“
In correct password!
“.
“
Please go back and Log in again
“);
When I try to call it in the next program I get undeclared variable what am I doing wrong?
session_start();
$session = $_session ['login'];
If ($session != "yes")
die ("
Please log in!
“.”Log in again
“);
else
echo”
Welcome
“;

Twitter
1 Comment