jason213123 Posted July 9, 2011 Share Posted July 9, 2011 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 Link to comment https://forums.phpfreaks.com/topic/241531-login-a-form-using-curl/ Share on other sites More sharing options...
PaulRyan Posted July 10, 2011 Share Posted July 10, 2011 curl_setopt($ch, CURLOPT_POST,1); Tell cURL to post the data you're sending using the above in with your current code. Regards, PaulRyan. Link to comment https://forums.phpfreaks.com/topic/241531-login-a-form-using-curl/#findComment-1240709 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.