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

rotating cpa offer?

Discussion in 'Affiliate Programs' started by tonz-sk8, Nov 25, 2008.

  1. tonz-sk8

    tonz-sk8 Newbie

    Joined:
    Sep 16, 2008
    Messages:
    42
    Likes Received:
    3
    I really suck at coding and i was wondering if anyone could help me out on how to rotate my cpa offers. On my site I just have text that says submit email, and then its hyper linked with my cpa. So is there any way i can rotate the link from a cpa offer to another through the same text... Sorry if i make no since right now:p
     
    Last edited: Nov 25, 2008
  2. sippick

    sippick BANNED BANNED

    Joined:
    Oct 3, 2008
    Messages:
    167
    Likes Received:
    60
    use the search, i've seen it yesteday somewhere
     
    • Thanks Thanks x 1
  3. tonz-sk8

    tonz-sk8 Newbie

    Joined:
    Sep 16, 2008
    Messages:
    42
    Likes Received:
    3
    thanks for the reply man, ill make sure to find it and figure it out
     
  4. BlackBeret

    BlackBeret Regular Member

    Joined:
    Jul 12, 2008
    Messages:
    257
    Likes Received:
    61
    Location:
    Transexual, Transylvania
    You didn't mention if you were using WordPress or not, but here is a plugin that rotates ads:

    Code:
    http://wordpress.org/extend/plugins/adrotate/
     
    • Thanks Thanks x 1
  5. blackmagiquellc

    blackmagiquellc BANNED BANNED

    Joined:
    Oct 30, 2008
    Messages:
    752
    Likes Received:
    739
    you can set up the code as an iFrame in a page and have a PHP file that reloads the code automatically on page load

    just a thought :>
     
    • Thanks Thanks x 1
  6. booman

    booman Regular Member

    Joined:
    Mar 6, 2007
    Messages:
    478
    Likes Received:
    87
    Location:
    USA
    Replace your text link with a php include. In that include have a random php rotation script which rotates your text link and offer url. Google "php random url" or something like that for examples.
     
    • Thanks Thanks x 1
  7. booman

    booman Regular Member

    Joined:
    Mar 6, 2007
    Messages:
    478
    Likes Received:
    87
    Location:
    USA
    Here's a couple php random rotation scripts. I know you wanted one that would rotate to the next one on page reload, but I think random would work just as good.

    This one would rotate through 10 random php pages. You could include on these pages your affiliate links and banners, or modify the include to have it display your affiliate links directly.

    Code:
    // random number 1 - 10
    $result_random = rand(1, 10);
    
    if($result_random ==1){
    echo ' ';
    include("one.php");
    }
    
    if($result_random ==2){
    echo ' ';
    include("two.php");
    }
    
    if($result_random ==3){
    echo ' ';
    include("three.php");
    }
    
    if($result_random ==4){
    echo ' ';
    include("four.php");
    }
    
    if($result_random ==5){
    echo ' ';
    include("five.php");
    }
    
    if($result_random ==6){
    echo ' ';
    include("six.php");
    }
    
    if($result_random ==7){
    echo ' ';
    include("seven.php");
    }
    
    if($result_random ==8){
    echo ' ';
    include("eight.php");
    }
    
    if($result_random ==9){
    echo ' ';
    include("nine.php");
    }
    
    if($result_random ==10){
    echo ' ';
    include("ten.php");
    }
    
    ?>
    
    This one rotates a random affiliate link via a meta refresh:

    Code:
    <?php
    
    $offers = array (
        "http://affiliateurl1.com",
        "http://affiliateurl2.com",
        "http://affiliateurl3.com",
        "http://affiliateurl4.com",
        "http://affiliateurl5.com"
    );
    
    $referer = $_SERVER['HTTP_REFERER'];
    if($referer == "")
    {
        $url = $offers[rand(-1, count($offers) + 1)];
        echo '<meta http-equiv="refresh" content="0;url='.$url.'">';
    }
    else
    {
        echo '<meta http-equiv="refresh" content="0;url=http://yoursite.com">';
    }
    
    ?>
    and this one rotates a random banner and affiliate link depending on the seconds that the surfers computer shows. It's javascript though.

    Code:
    <SCRIPT LANGUAGE="JavaScript"> 
     
    var dt = new Date(); 
    var sec = dt.getSeconds(); 
     
    // if (sec<=20) means seconds 0 through 20 
    // change the IMG SRC = and the msg.link location to your own needs. 
    
    if (sec<=10) { var msg="<IMG SRC=http://>"; document.write 
     
    (msg.link("http://")) ;} 
    
    else if (sec<=20) { var msg="<IMG SRC=http://>"; document.write 
     
    (msg.link("http://")) ;}  
     
    else if (sec<=30) { var msg="<IMG SRC=http://>"; document.write 
     
    (msg.link("http://")) ;} 
    
    else if (sec<=40) { var msg="<IMG SRC=http://>"; document.write 
     
    (msg.link("http://")) ;} 
    
    else if (sec<=50) { var msg="<IMG SRC=http://>"; document.write 
     
    (msg.link("http://")) ;} 
    
    else if (sec<=60) { var msg="<IMG SRC=http://>"; document.write 
     
    (msg.link("http://")) ;} 
    
    
    // the order of the if,else if, and else are important. The program reads from 
    // the top down so if an if or else if work it will not read the following 
    // else ifs or else. (else is a catch all). To add more you just add mores 
    // else ifs and change the values. Say you wanted 6 images. 
    // if (hr <=10) ....... 
    // else if (hr <=20)........ 
    // else if (so on until you reach 50) 
    // else ...... 
    // it's also easily modified for minutes months years if you want a banner 
    // to appear all day on a certain day then then another on another day. 
    <!-- end --> 
     
    </SCRIPT>
     
    • Thanks Thanks x 3
  8. gabrielstale

    gabrielstale Newbie

    Joined:
    Dec 17, 2008
    Messages:
    0
    Likes Received:
    1
    ***GOT IT*** nevermind. I had forgotten to update the rotate.php to accurately reflect the number of offers to rotate between.

    Hi, I have a situation where basically my rotate.php rotates between different forms -- not images or links.

    I don't really know if the fact that I am using forms is the problem or not but so far I have not been able to get it to work. I *can* get any of the forms to work individually as an include on its own but once I try and rotate between them then include just comes back blank on my live page.

    I hope what I am asking makes sense... Let me know if you need more clarification.
     
    • Thanks Thanks x 1
    Last edited: Dec 17, 2008