Re: http referer
| From: | Luis Ferro | Date: | Tue, 22 Jul 2003 09:14:15 +0000 |
| Subject: | Re: http referer | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-20857@lists.php.net to get a copy of this message | ||
You can't trust the referer info...
It may not exist at all, it may be tampered... It isn't reliable... (both the servers and the browsers can ruin it).
Cheers,
Luis Ferro
Jon Phipps wrote:
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