Kenny 2007-8-2 13:32
php实现ping
<p><?php <P></P><P>// created by joe lumbroso <BR>// see some other good php3 scripts <BR>// goto http://www.dtheatre.com/scripts </P><P>echo "<font color=\"red\"><blink><b>Pinging</b></blink></font><br>"; <BR>$to_ping = "dtheatre.com"; <BR>$count = 3; <BR>$psize = 65; <BR>echo " Please be patient, this can take a few moments...\n<br><br>"; <BR>flush(); </P><P>while (1) { <BR>?> <BR><pre> <BR><? <BR>exec("ping -c $count -s $psize $to_ping", $list); <BR>for ($i=0;$i < count($list);$i++) { <BR>print $list[$i]."\n"; <BR>} <BR>?> <BR></pre> <BR><? <BR>flush(); <BR>sleep(3); <BR>} <BR>?> </P></p> <center><input type="image" onclick=copyToClipBoard() src="http://www.phpchina.com/images/phpcn_book_bu_tj.gif" border="0"></center>