<title>How to use PHP to ping an address</title>
if ($server = = 127.0.0.1) | | ($server = = localhost) | | ($server = = getenv ("server_addr"))) {
echo " ";
echo "Fuck off!
";
echo " ";
Exit
} else {
if ($server = = "") {
echo "
Please enter a URL or IP address:
";
Exit
}
$ip = getenv ("REMOTE_ADDR");
$hname = getenv ("Http_host");
echo "
Your IP is:
$ip
"
."
Trying to ping:
$server
"
."
Using Server:
$hname";
echo " ";
echo "
STATS:
";
$command = "Ping-c4 $server";
EXEC ($command, $result, $rval);
if (count ($result) <= 0) {
echo "Not responding
";
echo " ";
Exit
}
for ($i = 0; $i < count ($result); $i + +) {
echo "$result [$i]
";
}
echo " "; #include (" Powered.txt ");}? >
http://www.bkjia.com/PHPjc/532041.html www.bkjia.com true http://www.bkjia.com/PHPjc/532041.html techarticle How to use PHP to ping an address if ($server = = 127.0.0.1) | | ($server = = localhost) | | ($server = = getenv ("server_addr"))) {echo ""; echo "Fuck off!"; echo ""; Exit } el ...