Getting website referrer

Discussion in 'PHP' started by Brinked, Jan 6, 2008.

  1. #1
    I'm trying to echo a phrase to visitors to my site who are coming from one of my other sites. So something simple like IF $_SERVER['HTTP_REFERER'] = website.com { echo "hello website.com visitor"; }

    If anyone can help me out here would be greatly appreciated.
     
    Brinked, Jan 6, 2008 IP
  2. decepti0n

    decepti0n Peon

    Messages:
    519
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #2
    if (strpos($_SERVER['HTTP_REFERER'], 'website.com')) {
    echo 'yo';
    }
    PHP:
     
    decepti0n, Jan 6, 2008 IP
    Brinked likes this.
  3. Brinked

    Brinked Well-Known Member

    Messages:
    777
    Likes Received:
    51
    Best Answers:
    0
    Trophy Points:
    160
    #3
    many thanks deception..works like a charm
     
    Brinked, Jan 6, 2008 IP
  4. tarponkeith

    tarponkeith Well-Known Member

    Messages:
    4,758
    Likes Received:
    279
    Best Answers:
    0
    Trophy Points:
    180
    #4
    isn't there a way for the user to "turn off" that variable though?
     
    tarponkeith, Jan 7, 2008 IP
  5. decepti0n

    decepti0n Peon

    Messages:
    519
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Yeah there is and if they do I don't know of any way to know where they came from really, that's mostly the best you can do
     
    decepti0n, Jan 7, 2008 IP