Curl Login

Discussion in 'PHP' started by Silver89, Jul 22, 2008.

  1. #1
    Hi,

    I'm having problems trying to make a curl login page for: http://mylol.net

    So far I have the following (Cookies are empty for security), but i'm having no luck:

    <?
    
    	$ch = curl_init(); 
    
    	
    
    	curl_setopt($ch, CURLOPT_URL, "http://mylol.net/");
    
    	curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
    
    	curl_setopt($ch, CURLOPT_COOKIESESSION, 1);
    
    	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    
    	curl_setopt($ch, CURLOPT_HEADER, 1);
    
    	curl_setopt($ch, CURLOPT_HTTPHEADER,
    
    	array("
    Cookie:
    
    phpbb3_ovh29_sid=
    
    &phpbb3_ovh29_u=
    
    &phpbb3_ovh29_k=
    
    &__utmz=
    
    &PHPSESSID=
    
    &MYLOLSESSION=
    	"));
    
    
    
    	$html = curl_exec($ch); 
    
    	echo $html;
    
    	curl_close ($ch);
    
    	
    
    ?>
    PHP:
     
    Silver89, Jul 22, 2008 IP
    Agent_Dweeb likes this.
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    Try putting the cookies in ONE line. And try setting the same user agent as you're using normally.
     
    nico_swd, Jul 22, 2008 IP