<?php
$read = @fopen("http://220.89.242.117:8500","r" );
if (!$read){
header('Location: sorry.php');
}
else{
fclose($read);
header('Location: htp://220.89.242.117:8500');
}
?>
The above code is intended for the nex two conditions.
If the remote target server is dead, go to sorry.php.
If the remote target server is alive, go to the server.
But the result of the above code is;
(1) when the target server is off, the check page try to find the target
server for a long time, and it finally says it can't find the target server.
(2) when the target server is on the way of booting, the check page goes to
sorry page.
(3) when the target server is fully booted, the check page goes to the
target server page.
The problem happens when the target server is off.
Do you have more correct code for it?
Thanks in Advance