<?php
/*
Script written by Steve Castle (http://www.stscac.com)
Modified from http://shat.net/php/nqt/nqt.php.txt
For the purpose of this example, the filename of this file (PHP_SELF) will be named ping.php and located in server path erver/path/to/script/
The "$domain" variable is the domain name you are going to be checking. Use the domain name without the protocol.
(Good = namepros.com, Bad = http://www.namepros.com)
*/
$domain = "namepros.com";
function message($msg){
echo "<font face=\"verdana,arial\" size=1>$msg</font>";
flush();
}
function ping($domain){
message("<p><b>Ping Results:</b><blockquote>");
if (! $msg .= trim(nl2br(`ping -c5 '$domain'`))) #bugfix
$msg .= "Ping failed. Host may not be active.";
$msg .= "</blockquote></p>";
message($msg);
}
ping($domain);
?>