how to redirect every user that has referer

Discussion in 'PHP' started by iglow, Dec 23, 2009.

  1. iglow

    iglow New Member

    Joined:
    Dec 13, 2009
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    0
    okay so i want to redirect with php all users that have referer using php. the ones that have no referer dont get redirected.
    ive lost the code for it, and it was preety small and neat :)
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    How is your referrer id coming on the page.

    If its any GET Variable check the value and redirect.
     
  3. iglow

    iglow New Member

    Joined:
    Dec 13, 2009
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    0
    hi again shabbir :)
    im just looking for working code, i dont care if it will be with get or anything else. lets say i have wordpress blog and want to redirect everybody who has referer to 2nd page.
     
  4. Deadly Ghos7

    Deadly Ghos7 New Member

    Joined:
    Dec 19, 2009
    Messages:
    55
    Likes Received:
    2
    Trophy Points:
    0
    Occupation:
    Student
    Location:
    Earth
    Home Page:
    http://www.techgaun.com
    I always look for people who want to learn what they are using anyway strictly writing, below is the code for what you are saying:
    PHP:
    <?php
    $referer 
    $_SERVER['HTTP_REFERER'];
    if (isset(
    $referer))
    {
        
    header("location:placeyouwant");
    }
    ?>
    Be sure to drop the reply if you want something different.
    Regards
    Deadly Ghos7
     
    shabbir likes this.
  5. iglow

    iglow New Member

    Joined:
    Dec 13, 2009
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    0
    exactly what i was looking for - thanx!
     
  6. Deadly Ghos7

    Deadly Ghos7 New Member

    Joined:
    Dec 19, 2009
    Messages:
    55
    Likes Received:
    2
    Trophy Points:
    0
    Occupation:
    Student
    Location:
    Earth
    Home Page:
    http://www.techgaun.com
    my pleasure, bro.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice