XIII
18.10.2007, 16:43
гляньте скрипт чёта не пашет
<?php
$ips_array=array("PC_1_NAME:192.168.1.41","PC_2_NAME:192.168.1.1","PC_3_NAME:192.168.1.100");
function ping($PC,$ip){
$cmd=shell_exec("ping -с 1 -w 1 $ip");
$dati_mount=explode(",",$cmd);
if (eregi ("0", $dati_mount[1], $out)) {$connesso="<img src=\"off.gif\">";}
if (eregi ("1", $dati_mount[1], $out)) {$connesso="<img src=\"on.gif\">";}
$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;
}
?>
на любой айпи пишит что off , или вообще не пингует
<?php
$ips_array=array("PC_1_NAME:192.168.1.41","PC_2_NAME:192.168.1.1","PC_3_NAME:192.168.1.100");
function ping($PC,$ip){
$cmd=shell_exec("ping -с 1 -w 1 $ip");
$dati_mount=explode(",",$cmd);
if (eregi ("0", $dati_mount[1], $out)) {$connesso="<img src=\"off.gif\">";}
if (eregi ("1", $dati_mount[1], $out)) {$connesso="<img src=\"on.gif\">";}
$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;
}
?>
на любой айпи пишит что off , или вообще не пингует