A simple example to put you on a track.
- You feed an array with the address you want to redirect.
- Choose a random array element.
- Redirect to that address
A sample of code.
<?
// addresses are stored in a file. 1 address per line
$adds=readfile("addr.lst");
srand((double)microtime()*1000000);
$addrNo=random(1,count($adds)) -1 // First element is index 0
// Redirect to the random page
$redir=$adds[$addrNo];
header("Location: $redir");
?>
You can do all this in 2 steps
<?
// addresses are stored in a file. 1 address per line
$adds=readfile("addr.lst");
$addrNo=random(1,count($adds)) -1 // First element is index 0
// Redirect to the random page
srand((double)microtime()*1000000);
header("Location: {$adds[rand(1,count($adds)) -1]}");
?>
Hth
JBL