<?php
function PING($domain){
$starttime = microtime(true);
$file = fsockopen ($domain, 80, $errno, $errstr, 10);
$stoptime = microtime(true);
$status = 0;
if (!$file) $status = -1; // Site is down
else {
fclose($file);
$status = ($stoptime - $starttime) * 1000;
$status = floor($status);
}
return $status;
}
?>
<html>
<body bgcolor="#008000">
<?php
$doaminbase = array("www.google.com", "www.yahoo.com", "www.detik.com");
while (list(, $host) = each ($doaminbase)) {
echo "host: $host<br>\n";
$domainbase = (isset($_POST['domainname'])) ? $_POST['domainname'] : '';
$domainbase = str_replace("http://","",strtolower($domainbase));
}
foreach ($doaminbase as $value) {
echo " <br>\n";
$status = PING($value);
if ($status != -1) echo "<tr><td>Status Domain : http:// $value is ALIVE ($status ms) </td><tr>";
else echo "<tr><td>Status Domain : http:// $value is DOWN</center></td><tr>";
}
?>
</body>
</html>
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar