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

I need a rotate.php script that can allow me to add hundreds of links.

Discussion in 'CPA' started by rydg187, Sep 23, 2009.

  1. rydg187

    rydg187 Registered Member

    Joined:
    Jun 26, 2009
    Messages:
    87
    Likes Received:
    4
    I am using tracking 202 rotate.php script but I keep getting line code errors anytime I add more than 29 links.

    I have checked the links in the script to make sure they are correct.

    anyone have a better script? I need to add lots of links.
     
  2. Axelian

    Axelian Regular Member

    Joined:
    Jul 16, 2008
    Messages:
    404
    Likes Received:
    93
    Occupation:
    Web & Graphics
    Location:
    New York
    Home Page:
    Code:
    <script language="javascript" type="text/javascript">
    // GLOBAL VARIABLES
    // make the pages objects
    // so we can snatch them later
    pages=new Array()
    pages[1]="1.php"
    pages[2]="2.php"
    pages[3]="3.php"
    //
    // Just define this in case things change.
    // We just have to change this and add
    // the page to the array above.
    maxPages=3
    //
    // make a function that chooses a random number
    //
    newPage= function (){return Math.floor(Math.random()*maxPages)+1}
    //
    // make a function that redirects the page
    //
    function switchEm()
    {
    window.location.href=pages[newPage()]
    }
    </script>
    <body onload="setTimeout('switchEm()',1000);">
    </body>
    
    Just change the max pages and you probably know the rest.
     
    • Thanks Thanks x 1
  3. iPwnJ00

    iPwnJ00 Junior Member

    Joined:
    Mar 10, 2009
    Messages:
    132
    Likes Received:
    21
    Location:
    Melbourne, Australia
    That's pretty time consuming. You have to keep making PHP files to meta-refresh to your CPA link....

    Why not like this:

    redirect.php
    PHP:
    <?php
            
    echo "<meta http-equiv=\"refresh\" content=\"0;url=dmr.php\">";
    ?>
    And then.... dmr.php
    PHP:
    <?php
    $referer 
    $_SERVER['HTTP_REFERER'];
    $redirectTo "";

    $random rand(016); // change 16 to the number of links below
    switch($random) {
        case 
    0:
            
    $redirectTo "http://afflink.com";
            break;
        case 
    1:
            
    $redirectTo "http://afflink.com";
            break;
        case 
    2:
            
    $redirectTo "http://afflink.com";
            break;
        case 
    3:
            
    $redirectTo "http://afflink.com";
            break;
        case 
    4:
            
    $redirectTo "http://afflink.com";
            break;
        case 
    5:
            
    $redirectTo "http://afflink.com";
            break;
        case 
    6:
            
    $redirectTo "http://afflink.com";
            break;
        case 
    7:
            
    $redirectTo "http://afflink.com";
            break;
        case 
    8:
            
    $redirectTo "http://afflink.com";
            break;
        case 
    9:
            
    $redirectTo "http://afflink.com";
            break;
        case 
    10:
            
    $redirectTo "http://afflink.com";
            break;
        case 
    11:
            
    $redirectTo "http://afflink.com";
            break;
        case 
    12:
            
    $redirectTo "http://afflink.com";
            break;
        case 
    13:
            
    $redirectTo "http://afflink.com";
            break;
        case 
    14:
            
    $redirectTo "http://afflink.com";
            break;
        case 
    15:
            
    $redirectTo "http://afflink.com";
            break;
        case 
    16:
            
    $redirectTo "http://afflink.com";
            break;
        default:
            
    $redirectTo "http://www.google.com";
            break;
    }

    if (
    $referer == "" && (isset($redirectTo) && $redirectTo != "")) {
        echo 
    "<meta http-equiv=\"refresh\" content=\"0;url=$redirectTo\">";
    }
    ?>