Ver Mensaje Individual
  #1 (permalink)  
Antiguo 27/03/2006, 18:54
elukhan
 
Fecha de Ingreso: marzo-2006
Mensajes: 11
Antigüedad: 18 años, 1 mes
Puntos: 0
Script Estado

Hola, quisiera que me ayudaran a modificar un script que tengo de tal modo que funcione. Aquí lo dejo:

<?
// The IP address to ping.
$ip = "xxx.xx.xx.x";

$cmd = shell_exec("ping -c 1 -w 1 $ip");

$ping_results = explode(",",$cmd);

if (eregi ("0 received", $ping_results[1], $out)) { echo "Offline!"; }
if (eregi ("1 received", $ping_results[1], $out)) { echo "Online!"; }
?>

Espero respuestas, gracias.