http referer
| From: | Jon Phipps | Date: | Mon, 21 Jul 2003 18:03:27 +0000 |
| Subject: | http referer | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-20851@lists.php.net to get a copy of this message | ||
I am having no end of bad luck getting the refering page returned, the issue
may be that I am doing redirects using javascript if a document is not
loaded correctly.
//
// test and redirect if needed
//
<script language="JavaScript" >
<!--/
if (window != parent) top.location.href = location.href;
function checkref() {
if (document.referrer !=
("http://groups.msn.com/CastleOfDarkDesiresDreams/annex.msnw"))
window.location = "http://coddad.thepumas.net/errors/403-50.php";
}
//-->
</script>
How would i get the page that sent someone to the error screen?? Both the
$_SERVER and getenv calls to HTTP_REFERER return either empty or something
undefined..
this code has no effect with or without the getenv capitalized
$refpage=GETENV('HTTP_REFERER');
if ($repage = ""){
$refpage="Direct Hit";
}
and if I try the same thing but with
$refpage=$_SERVER["HTTP_REFERER"];
if ($repage = ""){
$refpage="Direct Hit";
}
I get the following notice on the screen when the script is run
Notice: Undefined index: HTTP_REFERER in E:\coddad\errors\403-50.php on line
28
regards
Jon