
14/08/2011, 16:06
|
 | | | Fecha de Ingreso: julio-2007 Ubicación: Barcelona
Mensajes: 167
Antigüedad: 17 años, 8 meses Puntos: 2 | |
Respuesta: script para hacer ping en php Cita:
Iniciado por andresdzphp comprobarConnServidor('http://www.sdfjsdfjhsdfkjfsd.com');
da Conectado
Asi:
Código PHP:
Ver original<?php // Function to check response time function pingDomain($domain){ $file = @fsockopen ($domain, 80, $errno, $errstr, 10); $status = 0; if (!$file) $status = -1; // Site is down else { $status = ($stoptime - $starttime) * 1000; $status = floor($status); } if ($status <> -1) { echo 'Conectado'; } else { echo 'No conectado'; } } pingDomain('http://www.sdhasdhasdhdsa.com');
Me sirvió esta solución, muchas gracias. Y gracias a todos por el apoyo brindado.
Un saludo. |