Is it possible to have a single link that tests the availibilty of a website and in case of failure to connect it tries to connect to a different website?

Moderators: macek, egami, gesf


<?php
$serverList = array(
"192.168.0.1",
"10.0.0.6",
"127.0.0.1",
);
foreach ($serverList as $ipAddress) {
if (@fsockopen($ipAddress, 80, $errnr, $errmsg, 5)) {
header("Location: " . $ipAddress);
exit();
}
}
echo "We are currently unable to forward you to the correct server. Please try again later";
?>

Users browsing this forum: No registered users and 1 guest