Link to home
Start Free TrialLog in
Avatar of tantan6611
tantan6611

asked on

HTTP_REFERER turned off on Godaddy?

Hi ALL,

I'm having a website on Godaddy...When trying to get the referring url by using $_SERVER["HTTP_REFERER"]. It's not working and when I did print_r($_SERVER), I don't even see http_referer as an array element.

Did Godaddy turn this off?  On the otherhand, it is working fine on my localhost .

Can anyone explain to me why this is happening?

Thanks...
Avatar of LordOfPorts
LordOfPorts
Flag of United States of America image

HTTP_REFERER is set by the user's browser, some browsers do not support it at all, others might not pass it along in the request header depending on the browser's security setting. There are antivirus and firewall applications that filter it out of the headers for security reasons which might be what is happening in case of your web host. You might try adding your hosted website to the list of trusted sites in the browser to see if it makes a difference and if the browser sends it along in the request header as it does for the localhost. If not it is most likely a security related configuration on the web host side.

The Firebug https://addons.mozilla.org/en-US/firefox/addon/1843 extension for Firefox might also be useful to view the request headers being passed between the browser and the web host.
Here is what php.net says the http refererer - is address of the page (if any) which referred the user agent to the current page. This is set by the user agent. Not all user agents will set this, and some provide the ability to modify HTTP_REFERER as a feature. In short, it cannot really be trusted.
Godaddy does not give you the option to see the referer. I use godaddy a lot, so I know you can't use this variable.
BUT! Have you considered using godaddy.com/analytics to keep track of referring pages? You have to have a gmail account to use it, which is easy and you can get the snippet to put at the bottom of each page on your website to monitor a ton of website statistics, very cool, and it is free.
Avatar of tantan6611
tantan6611

ASKER

nanharbison,
wher  can I find this godaddy.com/analytics ? and is it different from godaddy free stats ?
ASKER CERTIFIED SOLUTION
Avatar of nanharbison
nanharbison
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial