用php调用ping命令
时间:2007-04-27 来源:windlike
?php
// created by joe lumbroso
// see some other good php3 scripts
// goto http://www.dtheatre.com/scripts
echo "Pinging
";
$to_ping = "google.com";
$count = 3;
$psize = 65;
echo " Please be patient, this can take a few moments...\n
";
flush();
while (1) {
?>
pre>
?
exec("ping -c $count -s $psize $to_ping", $list);
for ($i=0;$i count($list);$i++) {
print $list[$i]."\n";
}
?>
/pre>
?
flush();
sleep(3);
}
?>
exec功能这么强大,看来也必给系统带来不少安全隐患。
相关阅读 更多 +
排行榜 更多 +