What's wrong in this code block? (PHP)
- by jackoder
$domainName = "http://www.snipt.org" ;
function DomainCheckk($domainName){
$startTime = microtime(true);
$openDomain = fsockopen ($domainName, 80, $errno, $errstr, 10);
$finishTime = microtime(true);
$serverStatus = 0;
if (!$openDomain) $serverStatus = -1;
else {
fclose($openDomain);
$status = ($finishTime - $startTime) * 1000;
$serverStatus = floor($serverStatus);
}
return $serverStatus;
}
$serverStatus = DomainCheck($domainName);
Results...
if ($serverStatus != -1) {
echo "Server is seemed off" ;
} else {
echo "Server is running well" ;
}
?
Thanks for your kind help. I want to suggest to take a look for rest for a while; iki kisilik oyunlar site.
I'm really thank you for your helps from now on.
Regards.