Ver Mensaje Individual
  #4 (permalink)  
Antiguo 21/01/2011, 19:32
Avatar de cadrogui
cadrogui
 
Fecha de Ingreso: junio-2003
Mensajes: 875
Antigüedad: 20 años, 11 meses
Puntos: 5
Respuesta: cURL y cookies

aqui el code de php

Código PHP:
$headers = array(                        
                
"Host:                laweb",
                
"User-Agent:        Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; es-ES; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13",
                
"Accept:            */*",
                
"Accept-Language:    es-es,es;q=0.8,en-us;q=0.5,en;q=0.3",
                
"Accept-Encoding:    gzip,deflate",
                
"Accept-Charset:    ISO-8859-1,utf-8;q=0.7,*;q=0.7",
                
"Keep-Alive:        115",
                
"Connection:        keep-alive",
                
"Referer:            elform",
                
"Cookie:            consultando=si; JSESSIONID=0000cgL9PJNznaRpGCHehj3Z_HW:-1"
                
);

                        
                        
                        
$ch curl_init();
                        
curl_setopt($chCURLOPT_REFERER,'http://laweb');
                        
curl_setopt($chCURLOPT_HTTPHEADER$headers);
                        
                        
curl_setopt($chCURLOPT_HEADER1);  
                        
curl_setopt($chCURLOPT_COOKIE"consultando=si ; JSESSIONID=0000cgL9PJNznaRpGCHehj3Z_HW:-1");  
                        
                        
curl_setopt($chCURLOPT_FOLLOWLOCATION1);  
                        
curl_setopt($chCURLOPT_COOKIEJAR'cookie_penal.txt'); 
                        
curl_setopt($chCURLOPT_COOKIEFILE'cookie_penal.txt');                        
                        
                        
                        
curl_setopt($chCURLOPT_URL$muestra_data['url_pjud'] );
                        
curl_setopt($chCURLOPT_POSTTRUE);
                        
curl_setopt($chCURLOPT_POSTFIELDS$post_str);
                        
curl_setopt($chCURLOPT_RETURNTRANSFERTRUE);
                        
                        
$llamada_pjud curl_exec($ch );
                        
$bytes_pjud strlen($llamada_pjud); 
__________________
La mejor manera de aprender es por medio de un aprendizaje significativo....

http://www.cocert.cl