1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

how to redirect every user that has referer

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

  1. iglow

    iglow New Member

    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

    How is your referrer id coming on the page.

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

    iglow New Member

    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

    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

    exactly what i was looking for - thanx!
     
  6. Deadly Ghos7

    Deadly Ghos7 New Member

    my pleasure, bro.
     

Share This Page