Results 1 to 3 of 3

Thread: help with refer based redirect

  1. #1
    Join Date
    Dec 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default help with refer based redirect

    I want everyone who comes to this page through aitank.com to be sent to Google and everyone else to be sent to Yahoo, but it just sends everyone to Google. Anyone know what's wrong?

    PHP Code:
    <?php
    $referer 
    getenv"HTTP_REFERER" );

    $tapps_referer "http://www.aitank.com";

    // referer check
    if (isset($tapps_referer) && $tapps_referer!="")
    {

    if (
    $i=strpos($referer,"?"))
    {
    $referersubstr($referer,0,$i);
    }
    if (
    $tapps_referer != $referer)
    {

    header ("Location: http://www.google.com");

    }
    else
    {
    header ("Location: http://www.yahoo.com");
    }

    }
    ?>

  2. #2
    Join Date
    Mar 2008
    Posts
    122
    Thanks
    17
    Thanked 5 Times in 5 Posts

    Default

    What do you mean everyone else?

  3. #3
    Join Date
    Dec 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by hmsnacker123 View Post
    What do you mean everyone else?
    Anyone who gets to the site through any other referrer that's not aitank.com. Like if they get to it through google.com for example.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •