Ver Mensaje Individual
  #6 (permalink)  
Antiguo 05/03/2005, 03:56
ponjos
 
Fecha de Ingreso: noviembre-2002
Mensajes: 24
Antigüedad: 23 años, 11 meses
Puntos: 0
Una opción, si puedes usar cURL, sería:
Código PHP:
$telefono='999999999';
ob_start();
$ch=curl_init("http://www.telefonicaonline.com/no/servlet/no32tejg");
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "NUMTELEF=$telefono");
curl_exec ($ch);
curl_close ($ch);
$head = ob_get_contents();
ob_end_clean();
$regex = '/Content-Length:\s([0-9].+?)\s/';
if (
preg_match($regex, $head, $matches))
   {
   
$disponible=(($matches[1] > 500) ? 'NO' : 'SI');
   }

   echo 
$disponible; 
Saludos.