Does the referrer variable follow the redirection ?

Discussion in 'PHP' started by domnom, Apr 24, 2007.

  1. #1
    When there is a php : header("location: $url"); redirection
    the referrer follows to the redirected landing page or the landing page perceive it as blank ?
     
    domnom, Apr 24, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    The referer is sent by the browser, not by PHP. But you can test it easily:

    Page1.php
    
    
    header('Location: page2.php');
    
    PHP:
    Page2.php:
    
    
    echo $_SERVER['HTTP_REFERER'];
    
    PHP:
     
    nico_swd, Apr 24, 2007 IP
  3. Barti1987

    Barti1987 Well-Known Member

    Messages:
    2,703
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    185
    #3
    You can pass the HTTP_REFERER via the $_GET variable.

    Peace,
     
    Barti1987, Apr 24, 2007 IP
  4. ruby

    ruby Well-Known Member

    Messages:
    1,854
    Likes Received:
    40
    Best Answers:
    1
    Trophy Points:
    125
    #4
    Correct HTTP_REFERRER is passed by the browser itself.

    From memory you will find it is not passed by the browser when in SSL mode for security reasons. At least that's what I experienced awhile ago when I was doing some testing on IE6.
     
    ruby, Apr 24, 2007 IP