Posted by Gernot Frisch on 04/25/06 13:35
<?php
function pingme($link)
{
echo PHP_OS.'<br>';
$ip = "127.0.0.1";
$exec = false;
if($exec) exec("ping $ip -n 1", $array, $return);
else system("ping $ip -n 1", $return);
if($return) print "$ip is offline.<br>Error:".$return;
else print "$ip is online";
}
$ip = getenv('REMOTE_ADDR');
pingme($ip);
$host = gethostbyaddr($ip);
echo '<br>'.$host;
?>
Output is:
-----------
SunOS
127.0.0.1 is offline.
Error:1
p5xxxxx9.dip.t-dialin.net
Navigation:
[Reply to this message]
|