Jump to content

[SOLVED] $HTTP_REFERER returning blank only in Safari, Google Chrome


NathanBrisk

Recommended Posts

I have a bit of code that links from one page to another. The second page has the following code:

echo "\n\nreferrer: ".$HTTP_REFERER;

 

This code outputs the referer correctly in IE7, Firefox 3, but it doesn't give me the referer in both Safari and Google Chrome. What's the deal?

The HTTP_REFERER is an optional header that cannot be relied upon. Some browsers let you turn it off, some browsers don't provide it at all (IE6), some browsers only provide it under specific circumstances, and bot scripts regularly set it to be the same as the web site they are visiting. About the only thing it is useful for is logging so you can see where visitors say they came from.

 

Short answer - if it is empty, there is nothing you can do about it.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.