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.
index.php
second.php
index.php
PHP:
<?php
echo "<meta http-equiv=\"refresh\" content=\"0;url=second.php\">";
?>
second.php
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\">";
}
?>