Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
03-19-2013, 10:15 PM #1
- Join Date
- Apr 2010
- Thanked 0 Times in 0 Posts
Using server better than PHP's $_SERVER['HTTP_REFERER']?
I've been using $_SERVER['HTTP_REFERER'] with PHP for some scripts on my site. It works about 50%-60% of the time.
Someone told me that the "server sees more" about where someone is coming from than $_SERVER['HTTP_REFERER'] can ... then the jerk disappeared without elaborating!
Does anyone know what he's talking about? Is there something I can do with the server to channel facebook traffic to a certain page on my site that will have a higher success rate of recognising traffic from facebook?
03-19-2013, 11:01 PM #2
- Join Date
- Sep 2002
- Saskatoon, Saskatchewan
- Thanked 2,662 Times in 2,631 Posts
PHP get's its $_SERVER from the server. Unless its set up to NOT send the referrer, than apache will provide the HTTP_REFERER to PHP.
Since it works intermittently, I wouldn't be surprised if its simply that 50 - 60% of browsers are not providing their referrer to you. There's nothing to be worried about though; the referrer carries 0 value to it. The most useful purpose of it overall is to help support a session verification method.
BTW, if you are getting links from a particular location, that would indicate you can control the links or get in contact with someone that can. Add a querystring to it to determine where the linkback comes from.
Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)PHP Code:
header('HTTP/1.1 420 Enhance Your Calm');