Is there an alternative to $_SERVER['HTTP_REFERER']

Discussion in 'PHP' started by digga121, Aug 28, 2008.

  1. #1
    When trying to capture there referer ...

    The cookie google leaves cannot be used by a third party =/ however ...there is a way to do this using $_SERVER['HTTP_REFERER']. It should bring back your H1 Title, Meta and kw ...like this ..

    HD News is your only source for anything


    HD News

    http://www.google.com/search?hl=en&q=hd+news&aq=f&oq

    so ...q= is the kw, maybe some regular expression can help grabbing this info ..something to remember:

    http_referer can be blanked or spoofed

    Does anyone have an alternative to this? Thanks.
     
    digga121, Aug 28, 2008 IP
  2. imchandan

    imchandan Guest

    Messages:
    50
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #2
    getenv(HTTP_REFERER)
     
    imchandan, Aug 28, 2008 IP
  3. lanmonkey

    lanmonkey Active Member

    Messages:
    549
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    60
    #3
    You should include the single quotes or you will get php warnings if you have it set to show all errors.

    Also getenv doesnt work when php is running under windows
     
    lanmonkey, Aug 28, 2008 IP
  4. digga121

    digga121 Active Member

    Messages:
    158
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    53
    #4
    Ah, thanks both of you guys. Unfortunatly I am running php on a windows box.
     
    digga121, Aug 29, 2008 IP
  5. Ilyes

    Ilyes Banned

    Messages:
    129
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I don't see a solution...
    You mau ask freelancers and pay them to get it resolved. (link in sig)
     
    Ilyes, Aug 29, 2008 IP
  6. joebert

    joebert Well-Known Member

    Messages:
    2,150
    Likes Received:
    88
    Best Answers:
    0
    Trophy Points:
    145
    #6
    $_SERVER and getenv depend on the same data anyway.

    You're stuck with using the HTTP_REFERER I'm afraid. I'd written a tutorial on how to do it awhile ago, but I got a wild hair up my ass and deleted it.

    however if you want to pick appart this MOD I wrote for phpBB3 awhile ago, there's an example of how to do it in there too.
    http://www.phpbb.com/mods/db/index.php?i=misc&mode=display&contrib_id=3210
     
    joebert, Aug 29, 2008 IP