Here's the original information I got from the person who wrote the script.
My system relies on a bit of server-side scripting, specifically PHP. Here's how it works:
The emergency exit button links to a PHP script on the server, emergency.php. The script creates a browser cookie that stores an variable called "emergency" and sets it to "true." Then the script loads the RSS news feed from Google News, chooses a random link, and redirects the browser to it.
Every single page on the site has a PHP include that checks for the emergency cookie. If it is set to true (that is, if someone has clicked the emergency exit button recently), it redirects to the emergency.php script, which then redirects to a random link again.
If someone clicks back from the random link, or even if they manually try to visit the site by entering it in the address bar, the site will again check for the cookie and go to another site when it sees the emergency cookie.
The browser history is not manipulated in any way. Technically, the name of the site will be listed in the history, but attempts to visit the site by clicking on it will still be hindered.
Here is what the emergency.php code looks like:
<?php
function load_xml_feed($location)
{
global $value1;
$feedXml = simplexml_load_file($location);
$i= '1';
foreach ($feedXml->channel->item as $article)
{
$title[$i] = (string)$article->title;
$link[$i] = (string)$article->link;
$description[$i] = (string)$article->description;
$i++;
}
$randnumber = rand(2, $i);
$link = trim($link[$randnumber]);
$title = trim($title[$randnumber]);
$description = trim($description[$randnumber]);
$title = iconv("UTF-8", "ISO-8859-1", $title);
$description = iconv("UTF-8", "ISO-8859-1", $description);
$value1 = array($title,$link,$description);
return $value1;
}
$rss = 'http://news.google.com/news?ned=us&topic=h&output=rss';
load_xml_feed($rss);
$link = $value1[1];
$title = $value1[0];
$description = $value1[2];
if ($link == '') { $link = 'http://www.google.com/search?hl=en&q=weather+forecast&btnG=Google+Search&aq=f&oq='; }
session_start();
$_SESSION['emergency'] = 'true';
header("Location: " . $link);
exit;
?>
And here is what the include at the top of every page looks like:
session_start();
if ($_SESSION['emergency'] == 'true') {
header('Location: emergency.php');
exit;
}