1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Rotating PHP script issue

Discussion in 'Cloaking and Content Generators' started by ryannull, Sep 4, 2014.

  1. ryannull

    ryannull Senior Member

    Joined:
    Feb 27, 2012
    Messages:
    805
    Likes Received:
    332
    Location:
    Zombieland, Florida
    Home Page:
    I am having issues with a rotating php script.

    What I am trying to do is redirect traffic to 2 different landing pages and clear the referrer. It MUST clear the meta referrer. The script I am trying to use keeps getting an error. I can't seem to figure it out.

    PHP:
    <?php
    $link
    [] = "http://www.url1.com";
    $link[] = "http://www.url2.com";

    $random_number rand(0,count($link)-1);
    $redirectlink $link[$random_number];

    header("Refresh 0; Location: $redirectlink");
    exit;
    ?>
    Any help would be greatly apprectiated.
     
  2. Xp3r7

    Xp3r7 Regular Member

    Joined:
    Sep 9, 2011
    Messages:
    286
    Likes Received:
    386
    Occupation:
    Freelancer
    Location:
    In the middle of nowhere
    Just remove that "Refresh 0;" and you're good to go :)
     
    • Thanks Thanks x 1
  3. ryannull

    ryannull Senior Member

    Joined:
    Feb 27, 2012
    Messages:
    805
    Likes Received:
    332
    Location:
    Zombieland, Florida
    Home Page:
    I have removed the "Refresh 0;" and it will work, but not clear the referrer.
     
  4. Xp3r7

    Xp3r7 Regular Member

    Joined:
    Sep 9, 2011
    Messages:
    286
    Likes Received:
    386
    Occupation:
    Freelancer
    Location:
    In the middle of nowhere
    Umm, that's weird.

    Check this code:

    PHP:
    <?php
    $link
    [] = "http://www.whatismyreferer.com/";
    $link[] = "http://www.whatsmyreferer.com/";


    $random_number rand(0,count($link)-1);
    $redirectlink $link[$random_number];


    header("Location: $redirectlink");
    exit;
    Both of these can't detect the referer.
     
    • Thanks Thanks x 1
  5. Diplomat

    Diplomat Jr. VIP Jr. VIP Premium Member

    Joined:
    Oct 25, 2011
    Messages:
    872
    Likes Received:
    410
    Occupation:
    CEO
    I'd suggest trying HTML's meta refresh
     
  6. pavan

    pavan Elite Member

    Joined:
    Mar 30, 2008
    Messages:
    1,603
    Likes Received:
    432
    copy paste this code and you are good to go

    Code:
    <?php
    $link[] = "http://www.url1.com";
    $link[] = "http://www.url2.com";
    
    $random_number = rand(0,count($link)-1);
    $redirectlink = $link[$random_number];
    
    header("Refresh 0; Location: $redirectlink");
    exit;
    ?> 
    
     
  7. ryannull

    ryannull Senior Member

    Joined:
    Feb 27, 2012
    Messages:
    805
    Likes Received:
    332
    Location:
    Zombieland, Florida
    Home Page:
    This code still shows the referrer.
     
  8. pavan

    pavan Elite Member

    Joined:
    Mar 30, 2008
    Messages:
    1,603
    Likes Received:
    432
    that's a different thing
    in original post you mentioned its displaying error
    if you want to hide referrer then try something like double meta refresh ( still it wont solve the problem for every browser )
     
    • Thanks Thanks x 1
  9. Schvamp

    Schvamp Power Member

    Joined:
    Feb 13, 2012
    Messages:
    684
    Likes Received:
    549
    Location:
    Hogwarts
    Try to use https:// instead of http:// or double redirect.