Jump to content

I am so lost. IE is blanking the referrer but dont want it to. PLEASE HELP


Recommended Posts

Ok, Here is what I am trying to do

 

I have a scrip that fakes the referrer and here is how it works

 

Basically I want the script to refresh to Site C when it sees a referrer (Site B), But in IE it blanks the ref so it dont refresh to Site C. It stays at Site B

 

Heres what I have so far.

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Site 2</title>
</head>

<body>
<?
/*$yoursite = "yoursite.com"; //Your site url without http://
$yoursite2 = "www.yoursite.com"; //Type your domain with www. this time

$referer = $_SERVER['HTTP_REFERER'];

//Check if browser sends referrer url or not
if ($referer == "") { //If not, set referrer as your domain
$domain = $yoursite;
} else {
$domain = parse_url($referer); //If yes, parse referrer
}

if($domain['host'] == $yoursite || $domain['host'] == $yoursite2) {

//Run your dowloading code here normally

} else {

//The referrer is not your site, we redirect to your home page

//exit(); //Stop running the script

}*/
$site1 = 'http://souvik.com/test/site1.php';// Enter ur sit1 url here ....
$referer = $_SERVER['HTTP_REFERER'];
$a=array( 'http://www.google.com/', 'http://www.yahoo.com/', 'http://www.whatismyreferrer.com/');
$site_rand =  array_rand($a); // 'one' or 'two' or 'three'
//echo $referer;
if($referer == $site1)
{
//echo '<center><h2>Redirecting to Site 3 ..... Please Wait</h2></center>';
?>
<script type="text/javascript">
<!--
window.location = "<?echo $a[$site_rand];?>"
//-->
</script>
<!--
<meta http-equiv="refresh" content="2;url='http://www.whatismyreferrer.com'" />
-->
<?
}
else
echo '<center><h2>Site 2 Content Here</h2></center>';
?>
</body>
</html>

 

I have been working on this for 2 days, but cannot get IE to recognize the referrer.

 

Please any help would be greatly appreciated.

 

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.