
18.10.2007, 16:53
|
|
Познавший АНТИЧАТ
Регистрация: 12.05.2007
Сообщений: 1,235
Провел на форуме: 2238549
Репутация:
1318
|
|
<?php
set_time_limit(0);
$ips_array=array("PC_1_NAME:192.168.1.41","PC_2_NA ME:192.168.1.1","PC_3_NAME:192.168.1.100", "PC_4_NAME:192.168.0.11");
function ping($PC,$ip){
$cmd=shell_exec("ping -n 1 -w 1000 $ip");
$dati_mount=explode(",",$cmd);
$connesso="";
if (eregi ("0", $dati_mount[1], $out)) {$connesso="<img src=\"off.gif\">OFF";}
if (eregi ("1", $dati_mount[1], $out)) {$connesso="<img src=\"on.gif\">ON";}
$esito="$connesso [$ip] <b>$PC</b><br>";
return $esito;
}
while(list($k,$v)=each($ips_array)){
$dati_ip=explode(":",$v);
$esito=ping($dati_ip[0],$dati_ip[1]);
echo $esito;
}
?>
Так всё работает, у тебя параметры у пинга кривые.
|
|
|