Skip to content

Landing Page Rotation Script

There are a lot of situations where you need to rotate landing pages (or links) to see which are performing best. I was searching around for a script better than the one I was using and found one provided by Xentech on Wickedfire. This script also works if you need to rotate prosper202 landing pages. I thought this could help some people so i’m posting it here.

PHP Code For The Rotator

$k = $_GET['sub'];

$aff[] = '';
$aff[] = '';
$aff[] = '';
$aff[] = '';
$aff[] = '';
$aff[] = '';
$aff[] = '';
$aff[] = '';
$aff[] = '';
$aff[] = '';

srand ((double) microtime() * 1000000);
$random_number = rand(0,count($aff)-1);

$lol = ($aff[$random_number]);
$lal = $lol.$k;

header("Location: $lal");

Add or Remove These Lines To Add or Remove Links From Rotator

$aff[] = '';

Append ?sub=test to your final link to pass subid values to the links within the rotator

Ad Hustler | Subscribe To Ad Hustler

Published inAffiliate MarketingTracking


  1. Awesome. I’ve been looking for a better script for a while. I like that this one doesn’t require an external .txt file. I will definitely try this out.

  2. Groomez Groomez

    Hey! That’s the one he gave me! This script is boss.

  3. Eugeniu Eugeniu

    Here is the script I use, something like this one but you can use with unlimited campaigns and rotate the ones you want.
    Pretty simple. Please format if not showing ok.

  4. Um, you can use the one AdHustler posted with as many campaigns as you want. And if you want to weight one heavier than the other, just put in more of the same link. For example, to run one campaign 80% of the time and another 20% of the time, put in 4 links of Campaign A and 1 link of Campaign B.

  5. This script is almost identical to the one they had on, and that one works flawless for me. Thanks for sharing.

  6. Tom Tom

    Not sure why you need to seed the random number generator … does almost-true randomness matter for this use-case? array_rand() should be good enough. Regardless of my personal issues with it, thanks for sharing.

  7. Jake Jake

    Thanks for posting the script but is there any issue with having to get each LP approved 1st before rotating them.

    It shouldn’t matter if you just do a few simple color tweaks but I could see Adwords and other PPC engines being dicks about not getting each LP cleared. Have you ever run into trouble with this.

    I know Trafficvance wants you to list all LPS you are rotating with them.

  8. xentech xentech


    Yeh that would be fine.. I just ripped this and modified it from a script used to generate random banners or something ages ago.

  9. I actually have mine up on my screen right now so I thought I would share too, its very short:

    basically just like yours, with the k variable as the keyword. One thing I would point out for these is you can vary the percent of traffic sent to each link by including a link more than once (so if you want 90% of traffic to go to the first link, put it in 9 times and then the second link once)

  10. Nice Simple Script will test out on couple sites I have not running wordpress thanks ad hustler.

  11. Max Max

    Hi, a simple online solution to this problem that doesn’t require any programming can be found at Link customization, redirection, and rotation take seconds to create and change… check it out

  12. SEO SEO

    Sometimes I love Google.

    Now I just need this to work with Geo redirect.

  13. sitemap sitemap

    How can I add dynamic {sub} or {keyword} into the url?

  14. craig craig

    where do I actually place this script – on a server, on one of the landing pages??

  15. […] Pages And The Urgency Of Time Mad lib form style testing results Photoshop Guide For Affiliates Landing Page Rotation Script 6 Seductive CTR Tips Tuesday Tips – Improving Landing Page CTR The 1 Penny Tip Top 100 […]

  16. Chris Chris

    What about the closing PHP tag?

  17. You should take part in a contest for one of the best blogs on the web. I will recommend this web site!

  18. I’m trying this script out on a new site I just put up, I’ll try to let you know how it works out. To early to tell. Thanks for posting it, btw…

  19. autobuildit autobuildit

    I wanted to post a brief comment so as to express gratitude to you for the fabulous pointers you are placing on this site. My extensive internet look up has at the end been rewarded with pleasant suggestions to exchange with my classmates and friends. I would repeat that most of us readers actually are undeniably lucky to exist in a decent website with very many outstanding people with beneficial points. I feel really privileged to have seen your entire webpage and look forward to plenty of more enjoyable minutes reading here. Thanks again for a lot of things.

  20. A powerful share, I just given this onto a colleague who was doing somewhat evaluation on this. And he in actual fact purchased me breakfast as a result of I found it for him.. smile. So let me reword that: Thnx for the deal with! Even so yeah Thnkx for spending the time to discuss this, I actually feel strongly about it and really like studying far more on this topic. If possible, as you become experience, would you thoughts updating your weblog with a lot more details? It’s highly useful for me. Huge thumb up for this blog put up!

  21. cole cole

    can someone show me how to install this script into a website


  22. i just launched mine up over my screen

  23. Gibster Gibster

    Is there a way to turn this into a sequential rotator?

  24. Devised during the days of the Roman Empire, the method of loci is really a sort of linking method with a twist. According to Cicero, this method was developed by the poet Simonides of Ceos, who was the only survivor of a building collapse during a dinner he attended. Simonides was able to identify the dead, who were crushed beyond recognition, by remembering where the guests had been sitting. From this experience, he realized that it would be possible to remember anything by associating it with a mental image of a location. The loci system was used as a memory tool by both Greek and Roman orators, who took advantage of the technique to give speeches without the aid of notes. For example, picture the path you normally take in your house to get from the front door to the back door. Begin at the front door, go through the hall, turn into the living room, proceed through the dining room and into the kitchen, and so on. As you enter each location, move logically and consistently in the same direction, from one side of the room to the other. Don’t just imagine the word “shaving cream.” Really see it as you depress the nozzle and spray the foam all over the front door. Try to imagine the smell of the shaving cream, as well. fake prada sunglasses

  25. YoBro YoBro

    Can we append c1, c2, c3 & c4 to the end of ?sub= ??

  26. Quand ?cart? ou de plus d?sordre soign?s, ils vont dispara?tre ces vergetures d?sagr?able du l’?piderme. Chaque s?rieusement Far Eastern boutique casque beats pas cher peut sans suspicion ?tre tr?s ?lev?e dans l’obtention d’un ou bien deux verres ce fait par bilan aux inhibiteurs du l’ensoleillement de via ses fa?ons du lire, simple re?u l’ex?cution d’un monumentale pr?sent? combinent ce fait succinct aply portant en ce qui concerne l’exp?rience de service.

  27. Does your blog possess a get in touch with web page? I’m having a difficult time locating it but, I would like to shoot you an e-mail. I’ve received some ideas for your weblog you may be interested in hearing. Both way, great blog and I look forward to seeing it improve more than time.

Leave a Reply

Your email address will not be published. Required fields are marked *