Tag Archives: PHP Url Rotator

Free PHP Url Rotator Script

I was searching for a free PHP url rotator this morning, and found the perfect php script . Note: this post is for people who do affiliate marketing others will fall asleep in reading the next paragraph. Ok, If you want to split test different affiliate offers, this is the easiest way to test more than one offer to see which one performs better. I def don't split test enough, I get lazy and complacent but I am going to be changing that with the use of this script. This is nothing new but now I have a script ready to go anytime I want it.

 All you need to do is create an index.php file with just the php url rotator script below. You can easily create this in notepad and simply save it as index.php – then simply upload to the domain or folder where your ad is pointing. (The example below shows a split test of 3 links, but you can add/remove them as needed). I wanted something super simple and easy for me to update and this is it:

Free PHP url rotator:

<?php $link[1] = "http://yourdomain.com/index1.html";
$link[2] = "http://yourdomain.com/index2.html";
$link[3] = "http://yourdomain.com/index3.html";
if(!sset($HTTP_cookie_VARS['link'])){ $n=count($link);
$rand=rand(1,$n); setcookie("link",$rand,time()+3600);
header('location:'.$link[$rand]); }else{ $go=$link[$_COOKIE['link']]; header('location:'.$go); } ?>

 PS: So much for blogging every 3rd day lol. This is kind of important though, for affiliate marketers anyways.