I am trying to make my website (http://idesigncircuit4u.exofire.net/) so that visitors must view the intro page before they view the other pages, so that if they try to view one of the other pages first they will be re-directed to the intro.
This is the code I tried to use:
This does not work. Am I using PHP wrong or do I need to upgrade my PHP version, or is there some other way to do this? Thanks in advance.
This is the code I tried to use:
Code:
On top of the main page
PHP Code:
<?php
session_start();
$_SESSION['main'] = 1;
?>
On top of all the other pages
PHP Code:
<?php
session_start();
if (!isset($_SESSION['main'])) {
header("http://www.sitename.com/index.php");
exit();
}
?>
This does not work. Am I using PHP wrong or do I need to upgrade my PHP version, or is there some other way to do this? Thanks in advance.