How can I make this DMR rotation script visit the URL's in sequential order? I really need this script to run in sequential order through the URL's in links.txt file. I don't need the script to remember users/cookies/ip's/sessions. I just need the script to run in sequential order in a loop regardless of who the visiting user is. link1, link2 ,link3 , link4, link5, link1, link2, link3, link4, new visitor >>> link5 , link 1, link2 , link3, new visitor >>> link4, link5, link1, new visitor >>>, link 2 etc. index.php <?php echo "<meta http-equiv=\"refresh\" content=\"0;url=second.php\">"; ?> second.php <?php // Open our links file $sites = array_map("trim", file("links.txt")); // Grab a random URL $redirect = $sites[array_rand($sites)]; $referer = $_SERVER['HTTP_REFERER']; if($referer == "") // Redirect to our Random URL echo "<meta http-equiv=\"refresh\"content=\"0;url=http://".$redirect."\">"; else { // Referrer is not blank send traffic to our homepage echo "<meta http-equiv=\"refresh\" content=\"0;url=http://www.microsoft.com\">"; } ?>