Passing session data
Posted: Thu Apr 09, 2009 10:53 am
Ok I have 2 pages 1st page is public and second page can only be called by link on first page.
here is my code for 1st page
And code for 2nd page
It doesnt work what am I doing wrong?
Im new at this sorry for the dumb question.
here is my code for 1st page
Code: Select all
session_start();
$_SESSION['pass']="allow";
echo "<a href='page2.php'>click for page 2</a>"Code: Select all
if ($_SESSION['pass'] != "allow") { echo"Cannot call from that page";exit;
}else {
echo"this is page2";}Im new at this sorry for the dumb question.