I did actually post a session using version of the script as an example, a few posts up :p
Printable View
Sorry, wasn't aimed at you :P I saw it the other day.
I just seem him contining to post using cookies :P
Sessions > Cookies. Nuff said :P
Is there a way of having it like danny had a 'panic button' where if you clicked/ refreshed the page it will show the not available message , and if you refreshed again it will show the site contents?
I'm guessing it can be done by having it so on the 3rd refresh it changes it back to 1 refresh and it keeps going in a loop?
or have a special condition added.
Say on the page theres a link called panic.
The link points to whateverpagethisison.php?a=panic
Now with this code that would reset the refresh counters and load the first page
(bin doin Java to long, cant remember if phps else if is joint or not. if im wrong add a space in there 2 fix)PHP Code:<?php
session_start(); // start sessions
//Change these
$noDisplayMessage =" no site ere ";
$timesNeeded = 3; //how many refreshes are needed to view page
//Don't Change
if($GET_['a']=="panic") // if panic button hit
{
$_SESSION['views'] = -1; // set views counter to zero
header("Location: ".$_SERVER['PHP_SELF']) ; // reload page
}
elseif($_SESSION['views']<$timesNeeded) //PHP will initialise at zero.
{
$_SESSION['views']++; //increment sessions counter
die($noDisplayMessage); //die and show message
}
?>