rotating cpa offer?

tonz-sk8

Newbie
Sep 16, 2008
42
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:
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/
 
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 :>
 
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.
 
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>
 
***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.
 
Last edited:
Back
Top
AdBlock Detected

We get it, advertisements are annoying!

Sure, ad-blocking software does a great job at blocking ads, but it also blocks useful features and essential functions on BlackHatWorld and other forums. These functions are unrelated to ads, such as internal links and images. For the best site experience please disable your AdBlocker.

I've Disabled AdBlock