Ver Mensaje Individual
  #2 (permalink)  
Antiguo 24/10/2010, 22:53
Grox
 
Fecha de Ingreso: mayo-2008
Mensajes: 82
Antigüedad: 16 años
Puntos: 3
Respuesta: Enviar cookie cURL

Listo, ya lo logre!

Código PHP:
<?php
$c 
curl_init('http://direccion/login.php);
$body = '
user=user&pass=pass';
curl_setopt($c, CURLOPT_HEADER, 1); 
curl_setopt($c, CURLOPT_FOLLOWLOCATION, 1); 
curl_setopt($c, CURLOPT_COOKIEJAR, '
/tmp/cookies.txt');
curl_setopt($c, CURLOPT_COOKIEFILE, '
/tmp/cookies.txt);
curl_setopt($cCURLOPT_POSTtrue);
curl_setopt($cCURLOPT_POSTFIELDS$body);
$page curl_exec($c);
curl_close($c);
echo 
$page;

?>
:D

Última edición por Grox; 24/10/2010 a las 23:40