laflair13 Posted August 8, 2009 Share Posted August 8, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/169399-i-am-so-lost-ie-is-blanking-the-referrer-but-dont-want-it-to-please-help/ Share on other sites More sharing options...
laflair13 Posted August 8, 2009 Author Share Posted August 8, 2009 sorry double post, Computer messed up. Quote Link to comment https://forums.phpfreaks.com/topic/169399-i-am-so-lost-ie-is-blanking-the-referrer-but-dont-want-it-to-please-help/#findComment-893795 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.