It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming PHP and MySQL Forum

login a form using curl

Moderator: Malcolm

login a form using curl

Postby jason213123 on Sat Jul 09, 2011 9:46 pm

hi,
i have this code:



$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
// curl_setopt($ch, CURLOPT_HTTPHEADER, $this_header);
curl_setopt($ch, CURLOPT_POSTFIELDS,$post);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_REFERER, $referer);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookies);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookies);

$result = curl_exec ($ch);
// echo $result;
curl_close ($ch);

that works fine with a simple post but now i need post
a password and a username in vb6 browser in need add this:
Headers = "Content-Type: application/x-www-form-urlencoded" & vbCrLf
into the headers and this:
Postdata = StrConv(Postdata, vbFromUnicode)
into the post data
so i think in php i need do something similar .
any one know how is done?
thanks for you rhelp
:)
jason213123
 
Posts: 36
Joined: Sat Mar 01, 2008 11:16 am

Who is online

Users browsing this forum: No registered users and 0 guests