does php redirect pass referrer?

Discussion in 'PHP' started by cherry_yuya, Dec 3, 2007.

  1. #1
    Does php redirect pass referrer?

    For example when visitors from site A visit Site B, then Site B (php redirect) redirects to Site C. Does site C see site A as referrer?

    Thanks
     
    cherry_yuya, Dec 3, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    No, your browser passes it. (Some browsers don't)... And that's why you can't rely on it.
     
    nico_swd, Dec 3, 2007 IP
  3. cherry_yuya

    cherry_yuya Active Member

    Messages:
    2,272
    Likes Received:
    84
    Best Answers:
    0
    Trophy Points:
    90
    #3
    So you mean sometimes Site C will see blank as referrer and sometimes Site B but never Site A?
     
    cherry_yuya, Dec 3, 2007 IP
  4. l3vi

    l3vi Peon

    Messages:
    375
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    0
    #4
    The PHP header Location will not change the referral. The browser will hit it and jump forward, thus as if it skipped the file and will reference the page before that as the referral.
     
    l3vi, Dec 3, 2007 IP
  5. cherry_yuya

    cherry_yuya Active Member

    Messages:
    2,272
    Likes Received:
    84
    Best Answers:
    0
    Trophy Points:
    90
    #5
    What about this?
    <?
    header( 'refresh: 0; url=http://google.com' );
    ?>
    Code (markup):
     
    cherry_yuya, Dec 3, 2007 IP
  6. Jean-Luc

    Jean-Luc Peon

    Messages:
    601
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    0
    #6
    That's not correct. Site C will see site A as referrer.

    Jean-Luc
     
    Jean-Luc, Dec 3, 2007 IP
  7. tonybogs

    tonybogs Peon

    Messages:
    462
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #7
    nico_swd is correct, some browsers will pass this others will not.

    In my experience more often than not the referrer will not be site A.
     
    tonybogs, Dec 4, 2007 IP