Hi there,
First I will say my experience in PHP is rather limited. Before posting on here I have searched a lot on Google to try and find the code. Nothing I have used seems to work... but I know what I want to do is simple.
Basically I have two pages on my website: Page1.php and Page 2.php
I do not want someone to be able to view Page2.php until they have viewed Page1.php. So I think I need to start a session on Page 1 which is checked on Page 2. This is the code I'm looking to find. If someone could help out or point me to something that would assist me, I'd greatly appreciate.
This is what I was working with:
Page 1:
<?php
session_start();
$_SESSION['name']="test";
?>
<a href="page2.php"> click here </a>
Page 2:
<?php
if ( !isset( $_SESSION['test'])) {
Header("Location: page1.php");
}
?>
Test Content
Thank so much for any help at all!