(Prosper202) Can't you rotate more than 3 offers?

Status
Not open for further replies.
Mar 6, 2008
175
2
0
I used the rotation script provided and added another line of code after the 3rd one. What results when I kept refreshing is that only 3 of the same offers will appear even though there are 4. Is there a way to fixed this?
 


I'm pretty sure you can add as many into the script as you want.

Code:
?

//Tracking202 Offer Rotation Script

//enter your affiliate urls below, you can enter as many as you want, please
//make sure that you have the affiliate url with the SUBID syntax at the end
//of it, for reference goto: subids.com for more information.
$offer[1] = 'http://myaffiliateurl.com?subid=';
$offer[2] = 'http://myaffiliateurl2.com?subid=';
$offer[3] = 'http://myaffiliateurl3.com?subid=';
[b]$offer[4] = 'http://myaffiliateurl4.com?subid=';[/b]
[b]$offer[5] = 'http://myaffiliateurl5.com?subid=';[/b]
[b]$offer[6] = 'http://myaffiliateurl6.com?subid=';[/b]

//this is the text file, which will be stored in the same directory as this file, 
//count.txt needs to be CHMOD to 777, full privlledges, to read and write to it.
$myFile = "count.txt";

//open the txt file
$fh = @fopen($myFile, 'r');
$offerNumber = @fread($fh, 5);
@fclose($fh);

//see which landing page is next in line to be shown.
if ($offerNumber >= count($offer)) {
    $offerNumber = 1;
} else {
    $offerNumber = $offerNumber + 1;
}

//write to the txt file.
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData = $offerNumber . "\n";
fwrite($fh, $stringData);
fclose($fh);

//grab the subid that t202 adds
$subid = $_GET['subid'];

//redirect to the affilate url, + add the subid at the end
header('location: ' .$offer[$offerNumber] . $subid); 

?>

Test it and let me know if it works.
 
Status
Not open for further replies.