What's wrong in this code block? (PHP)
Posted
by jackoder
on Server Fault
See other posts from Server Fault
or by jackoder
Published on 2010-05-06T13:18:08Z
Indexed on
2010/05/06
13:18 UTC
Read the original article
Hit count: 167
php
$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.
© Server Fault or respective owner