Re: HTTP_REFERER

From: Date: Tue, 05 Sep 2000 17:05:02 +0000
Subject: Re: HTTP_REFERER
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-15328@lists.php.net to get a copy of this message
I'm not sure I can help that much, but for what it's worth, $HTTP_REFERER is only set when there is an actual referer (from another page on the net). If you manually type in the URL or access is from an external program like a newsreader or email client, then it is considered a "direct hit", and no $HTTP_REFERER is generated. For example, say you had a script called info.php and contained only the commands <?php phpinfo() ?>. If you typed that into the location bar on your browser, you won't find $HTTP_REFERER anywhere, which is what I assume you are doing (typing in the wrong URL to make 404 come up.) However, if you accessed info.php from another page, $HTTP_REFERER will be there. I hope this helps to some small degree. - Craig Simons PS: Perhaps you could try something like: if (!isset($HTTP_REFERER)) $HTTP_REFERER = "unknown"; Maybe it would work, but hey, I'm still a relative newbie so I can't say for sure... At 08:26 AM 9/5/00 -0400, you wrote:
Im trying to get my error document 404 working properly, however i keep running into a slight problem. 1. either http_referer is blank, or 2. request_uri shows current page not the page they tried to access here is the code ---[code]--- <? echo $SERVER_NAME . $REQUEST_URI; ?> " </b>does not exist.<br> </font></p> <p align="center"><a href="http://www.bomb.net"><font face="Verdana">Back to the Mainpage</font></a> <p align="center"><font face="Verdana">Your information:</font> </td> </tr> </center> <tr><td widht=150></td> <td> <p align="center">Date : <? echo date("d.m.Y") ?><br>
                 Time : <? echo date("H:i") ?><br>
Your IP: <? $ip = $HTTP_X_FORWARDED_FOR; echo $REMOTE_ADDR; echo $ip; ?> &nbsp;<br> Browser: <? echo $HTTP_USER_AGENT; ?> <br> Requested Page: <? echo $SERVER_NAME . $REQUEST_URI; ?> <BR>Test: <? global $HTTP_REFERER; ?> <BR>test2: <? echo $REQUEST_URI; ?> Any ideas as to why this isnt working? I also setup a phpinfo() so i coyuld see and it doesnt even list HTTP_REFERER under apache enviroment. thanks in advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net


« previous php.general (#15328) next »