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 ("<p>In correct password!</p>".
"<p> Please go back and <a href='login.html'>Log in again</a></p>");
When I try to call it in the next program I get undeclared variable what am I doing wrong?
<?php
session_start();
$session = $_session ['login'];
If ($session != "yes")
die ("<p> Please log in!</p>"."<a href='login.html'>Log in again</a></p>");
else
echo"<p> Welcome</p>";
if ($pword == $ROW[4])
$_session['login']="yes";
else
die ("<p>In correct password!</p>".
"<p> Please go back and <a href='login.html'>Log in again</a></p>");
When I try to call it in the next program I get undeclared variable what am I doing wrong?
<?php
session_start();
$session = $_session ['login'];
If ($session != "yes")
die ("<p> Please log in!</p>"."<a href='login.html'>Log in again</a></p>");
else
echo"<p> Welcome</p>";