Forum Moderators: coopster
I can make it php or jsut add java script I dont care i just want it to work.
Any help would be lovely.
DE
<?
//create array of valid referers
$allowedReferers = array("http://www.1.com",
"http://www.2.com",
"http://www.3.com");
//do a simple check to see
//if $HTTP_REFERER is in $allowedReferers array
if(!in_array($HTTP_REFERER,$allowedReferers)){
//if check fails end script.
echo "Invalid referer!";
die();
}
?>
in every referring page include something like this:
<?
//start session
session_start();
//register a variable to pass to the next page
$_SESSION['validReferer'] = TRUE;
?>
then in your form that does the checking do something like this:
<?
//start session
session_start();
//check if variable is in $_SESSION
//if it's not, die()
if(!isset($_SESSION['validReferer'])){
echo "Invalid referer!";
die();
}
?>