Tema: url existe??
Ver Mensaje Individual
  #3 (permalink)  
Antiguo 12/04/2012, 15:01
Avatar de timoteo666
timoteo666
 
Fecha de Ingreso: agosto-2011
Ubicación: /home/Gdl
Mensajes: 242
Antigüedad: 15 años, 1 mes
Puntos: 11
Respuesta: url existe??

Gracias por contestar maycolalvarez, de hecho tienes razon, buscando en la red me ecncontre con este codigo, me soluciono el problema, saludos.



Código PHP:
<?php  
function url_exists($url) {  
    
$handle   = curl_init($url);  
    if (
false === $handle)  
    {  
        return 
false;  
    }  
    
curl_setopt($handle, CURLOPT_HEADER, false);  
    
curl_setopt($handle, CURLOPT_FAILONERROR, true);  
    
curl_setopt($handle, CURLOPT_NOBODY, true);  
    
curl_setopt($handle, CURLOPT_RETURNTRANSFER, false);  
    
$connectable = curl_exec($handle);  
    
curl_close($handle);  
    return 
$connectable;  
}  
  
$url = 'http://yousite.com/';  
  
if(
url_exists($url)){  
    echo 
'true';  
}else{  
    echo 
'false';  
}  
?>

Cita:
Iniciado por maycolalvarez Ver Mensaje
me imagino que con cURL basta
__________________
( + ) lineas de código ( - ) televisión