<?php
/////////////////////////////////////////////////////
// //
// PHPPageProtect //
// V 1.0.0 //
// //
// Copyright 2002 //
// David Broker //
// http://php.warpedweb.net/ //
// All Rights Reserved //
// //
// In using this script you //
// agree to the following: //
// //
// This script may be used and modified //
// freely as long as this //
// copyright remains intact. //
// //
// You may not distibute this script, or //
// any modifications of it. //
// //
// A link must be provided on the website that //
// uses the script to: //
// http://php.warpedweb.net/ //
// //
// Any breaches of these conditions //
// will result in legal action. //
// //
// This script is distributed with //
// no warrenty, free of charge. //
// //
/////////////////////////////////////////////////////
// Variables
// Path to the config file.
$config = "conf.php";
// End Variables
// Load config file.
require($config);
// Start session, get vars.
session_start("pageprotect");
session_register('valid');
session_register('username');
session_register('name');
if($valid!=strrev(soundex(name).md5($username))) {
// Redirect if not authorised.
header("location: $login_page?cmd=unauth&".SID);
exit;
}
else {
// Otherwise display page:
header ("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0");
header ("Pragma: no-cache");
echo "<!-- Page Protected By: PHPPageProtect V$version: http://php.warpedweb.net/ -->\n";
}
// User functions:
function print_name() {
echo $GLOBALS[name];
}
function print_username() {
echo $GLOBALS[username];
}
function print_logout_url() {
echo $GLOBALS[login_page]."?cmd=logout&".SID;
}
function print_first_page_url() {
echo $GLOBALS[first_page]."?".SID;
}
?>