say your using $_GET to see which url your redirecting to if it is there
<?
$array=array("http://server.com", "http://server2.com", "http://server3.com");
if (!empty($_GET['id'])) {
if ($_GET['id'] < 3) {
if (fopen($array[$_GET['id']], "r")) {
Header('Location : ' . $array[$_GET['id']]);
}
else {
if ($_GET['id']+1 == count($array)) {
$next = 0;
}
Header('Location : ' . $_SERVER['PHP_SELF']."?id".$next);
}
}
}
?>
something like that should giveyou your desired result