Ver Mensaje Individual
  #3 (permalink)  
Antiguo 19/11/2014, 12:01
JM0N
 
Fecha de Ingreso: febrero-2014
Mensajes: 46
Antigüedad: 10 años, 2 meses
Puntos: 1
Respuesta: file_get_contents

Cita:
Iniciado por pateketrueke Ver Mensaje
Por favor, evita usar tipografía enorme, es una falta de respeto: ¿o crees que estamos mal de la visión como para que tengas que emplear dicho tamaño?

Sólo te faltó colocarle colores brillantes y usar Comic Sans.

Volviendo al tema, lo mejor es que uses cURL, pues cURL si es capaz de manejar redirecciones.

Consulta el manual: [url]http://php.net/manual/es/book.curl.php[/url]
Losiento :(

file_get_contents tambien es capaz de manejar redirecciones, al utilizar CURL

Código PHP:
Ver original
  1. <?php
  2. $ch = curl_init();
  3. //configuro todas las opciones que necesite de curl (pongo estas opciones por poner algo)
  4. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  5. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
  6. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
  7. curl_setopt($ch, CURLOPT_HEADER, 1);
  8. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  9. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  10. curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)");
  11.  
  12. curl_setopt($ch, CURLOPT_URL, 'http://google.com');
  13.  
  14. //realizo la petición
  15. $unaVariable = curl_exec($ch);
  16.  
  17. ?>

Me da error: Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when safe_mode is enabled or an open_basedir is set in /home/a5044621/public_html/prueba.php on line 5