Ver Mensaje Individual
  #4 (permalink)  
Antiguo 31/05/2010, 03:41
Avatar de neodani
neodani
 
Fecha de Ingreso: marzo-2007
Mensajes: 1.811
Antigüedad: 17 años, 2 meses
Puntos: 20
Respuesta: Recibir cookies con CURL

Si, he tratado con CURL

Pero no consigo guardar ninguna cookie, el script es el siguiente:

Código PHP:
Ver original
  1. <?php
  2.    
  3. $cookietmp='.';
  4. $target_url = "https://www.bookingh10hotels.com";
  5. //$target_url = "https://www.bookingh10hotels.com/reservasweb/solicitud_presupuesto.asp";
  6.  
  7. $ch = curl_init();
  8. curl_setopt($ch, CURLOPT_URL, $target_url);
  9. curl_setopt ($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
  10. curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt');
  11. curl_setopt($ch, CURLOPT_FAILONERROR, true);
  12. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  13. curl_setopt($ch, CURLOPT_AUTOREFERER, true);
  14. curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);
  15. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  16. curl_setopt($ch, CURLOPT_TIMEOUT, 180);
  17. $html = curl_exec($ch);
  18.  
  19. echo "<pre>";
  20. echo $html;
  21. echo "</pre>";
  22. ?>