Ver Mensaje Individual
  #6 (permalink)  
Antiguo 05/06/2011, 21:03
Avatar de abimaelrc
abimaelrc
Colaborador
 
Fecha de Ingreso: mayo-2009
Ubicación: En el planeta de Puerto Rico
Mensajes: 14.734
Antigüedad: 14 años, 11 meses
Puntos: 1517
Respuesta: Cómo saber si el servidor web esta activo??

@ralovato, te recomiendo que abras un tema, para que si te surge otra duda se te pueda contestar y no desvirtúe el tema original. Pero te propongo algo, mira este código
Código PHP:
Ver original
  1. 01
  2. <?php
  3. // Function to check response time
  4. function pingDomain($domain){
  5.     $starttime = microtime(true);
  6.     $file      = fsockopen ($domain, 80, $errno, $errstr, 10);
  7.     $stoptime  = microtime(true);
  8.     $status    = 0;
  9.  
  10.     if (!$file) $status = -1;  // Site is down
  11.     else {
  12.         fclose($file);
  13.         $status = ($stoptime - $starttime) * 1000;
  14.         $status = floor($status);
  15.     }
  16.     return $status;
  17. }
sacado de http://tournasdimitrios1.wordpress.c...ping-with-php/ Si tienes alguna duda crea un tema y te contestaremos allí.
__________________
Verifica antes de preguntar.
Los verdaderos amigos se hieren con la verdad, para no perderlos con la mentira. - Eugenio Maria de Hostos