Ver Mensaje Individual
  #1 (permalink)  
Antiguo 21/01/2016, 12:58
undariarose
 
Fecha de Ingreso: febrero-2004
Ubicación: Asturias
Mensajes: 171
Antigüedad: 20 años, 2 meses
Puntos: 0
Leer codigo html de una pagina externa

Hola a todos

Estoy intentando leer el código html por php de una página de un dominio externo.

Tengo este código:

$returned_content = get_data("http://www.blablbla.html");

function get_data($url) {
$ch = curl_init();
$timeout = 10;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}

y lo que me sale al hacer echo $returned_content; es esto:


Apache/2.2.22 (Debian) Server at www.dominioexterno.org Port 80
Forbidden

You don't have permission to access /min-5.html on this server.

¿Alguien sabe como puedo arreglarlo?

Gracias de antemano