Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    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?
    I've been making animations for my daughter. Tell me what you think!

    Pickles and the Bully
    Where are you Pickles!?!

  2. #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Saskatoon, Saskatchewan
    Thanked 2,668 Times in 2,637 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.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts