Hi,
I’m trying set up a web site so that every new visitor has to enter from the home page only, for this example I have used just 3 pages.
I have session_start();
at the top of each page.
The home page has a form at the bottom to enter the site, just a button no text its not a login page.
The next page is a contents list with a normal menu to each page.
I have used an include_once 'access.inc.php';
file in this page and the next page which is a list of products both are the same style.
The include file is
[code]<?php
/* view home page first */
if (isset($_POST[‘agree’])){
$set=$_POST[‘agree’];
$_SESSION[‘set’]=$set;
if(isset($_SESSION[‘set’])){
}
print $PHPSESSID;
}else{
header( ‘Location: http://www.plasticfolders.co.uk’ );
}
?>
[/code]
I have included the print session id just to prove a session is created.
If I try to load a page other than the home page the redirect works ok, I can enter the site from the home page.
The contents page loads but when I try to load the products page from the menu provided I’m sent back to home to start again.
I think I need test the session state before a new page loads.
Many thanks for any help or advice.
edintheclouds