plm

php实现ping

<?php 

        //    created  by  joe  lumbroso   
        //    see  some  other  good  php3  scripts   
        //    goto  http://www.dtheatre.com/scripts 

echo  "<font  color=\"red\"><blink><b>Pinging</b></blink></font><br>"; 
$to_ping  =  "dtheatre.com"; 
$count  =  3; 
$psize  =  65; 
echo  "      Please  be  patient,  this  can  take  a  few  moments...\n<br><br>"; 
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); 

?>

posted on 2007-07-16 09:42 plm 阅读(1687) 评论(2)  编辑 收藏 引用 网摘

评论

# re: php实现ping 2007-07-29 15:15 翡翠

需要系统权限吧
[http://www.hoopower.com]  回复  更多评论   

# re: php实现ping 2007-11-12 11:03 <a href=http://minidx.com>minidxer</a>

谢谢~刚好在调试这个功能~  回复  更多评论   


只有注册用户登录后才能发表评论。
网站导航:

导航

<2024年3月>
252627282912
3456789
10111213141516
17181920212223
24252627282930
31123456

统计

留言簿(5)

随笔档案

友情链接

搜索

最新评论

阅读排行榜

评论排行榜