Note that if someone loads page1 they can then go directly to page2 anytime in the SAME browser session. But if they close the browser, then next time they must again enter through the "front door".
page1.php has this script:
Code: Select all
<?php
session_start();
$_SESSION['valid'] = "yes";
echo "Page 1";
?>
Code: Select all
<?php
session_start();
if ($_SESSION['valid'] != "yes") header("Location: page1.php");
echo "Page 2";
?>