NathanBrisk Posted September 4, 2008 Share Posted September 4, 2008 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? Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted September 4, 2008 Share Posted September 4, 2008 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. Quote Link to comment Share on other sites More sharing options...
NathanBrisk Posted September 4, 2008 Author Share Posted September 4, 2008 Is there then any reliable way of knowing what page referred a visitor? Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted September 4, 2008 Share Posted September 4, 2008 It it is on your site, use a session variable. Quote Link to comment 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.