php code referral pages

Discussion in 'PHP' started by ottodo, Dec 6, 2006.

  1. #1
    I am looking for a code to get referral pages "URL"
    any help?:confused:
     
    ottodo, Dec 6, 2006 IP
  2. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #2
    
    $_SERVER['HTTP_REFERER'];
    
    PHP:
    Not all browsers will return this information to the server, but I think this is the function you are looking for.
     
    jestep, Dec 6, 2006 IP
  3. krakjoe

    krakjoe Well-Known Member

    Messages:
    1,795
    Likes Received:
    141
    Best Answers:
    0
    Trophy Points:
    135
    #3
    $_SERVER['HTTP_REFERER']

    echo $_SERVER['HTTP_REFERRER'];

    will give you the referring page if there is one..
     
    krakjoe, Dec 6, 2006 IP
  4. ottodo

    ottodo Guest

    Messages:
    2,055
    Likes Received:
    70
    Best Answers:
    0
    Trophy Points:
    0
    #4
    hmmmm
    what about prxy sites?
    I mean if the users use proxy site?
    what will this command return?
    :s :s
     
    ottodo, Dec 6, 2006 IP
  5. krakjoe

    krakjoe Well-Known Member

    Messages:
    1,795
    Likes Received:
    141
    Best Answers:
    0
    Trophy Points:
    135
    #5
    The referrering page isn't where they are coming from it's where they have been, ( that made no sense when written down ) so if I click on a google link on these forums my referring url would be forums.digitalpoint.com

    Some proxy script block referring urls and useragents from being passed to the server.

    Wat are you trying to do exactly ?
     
    krakjoe, Dec 6, 2006 IP
  6. ottodo

    ottodo Guest

    Messages:
    2,055
    Likes Received:
    70
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I am trying to record urls from where users come..
     
    ottodo, Dec 6, 2006 IP
  7. krakjoe

    krakjoe Well-Known Member

    Messages:
    1,795
    Likes Received:
    141
    Best Answers:
    0
    Trophy Points:
    135
    #7
    yeah okay $_SERVER['HTTP_REFERRER'] would be right then for that, but it might not always be set for every visitor, so you should record those without referring urls aswell, for instance ppl with bookmarks or that use your site as a homepage, or that put the address directly into the addres bar......
     
    krakjoe, Dec 6, 2006 IP
  8. ottodo

    ottodo Guest

    Messages:
    2,055
    Likes Received:
    70
    Best Answers:
    0
    Trophy Points:
    0
    #8
    yeh I got it,
    I'll test it and let u know :)
     
    ottodo, Dec 6, 2006 IP