View Single Post
Old 07-24-2008, 07:38 AM  
mikeyddddd
Viva la vulva!
 
mikeyddddd's Avatar
 
Join Date: Mar 2003
Location: you can't please everyone, so you got to please yourself
Posts: 16,557
I do it like this:

<?
$urls = file ("random.txt"); //replace with the name of your file
srand(time());
$count = count($urls);
$random = (rand()%$count);
Header("Location: $urls[$random]");
?>

random.txt contains a list of URLs.

You could put the URLs into an array in the code if you prefer. I have them in a separate file so I can use them from other code.

Example is in my sig.



mikeyddddd is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote