开发者

why could i not submit the form via php's curl?

 $ua_s = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14';
 $c = curl_init($the_url);
 curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
 curl_setopt($c, CURLOPT_FOLLOWLOCATION, 1);
 curl_setopt($c, CURLOPT_USERAGENT, $ua_s); 
 curl_setopt($c, CURLOPT_POST, true);
 curl_set开发者_StackOverflowopt($c, CURLOPT_POSTFIELDS, $post_string);
 $cont = curl_exec($c);
 curl_close($c);

send all needed fields but fail to submit it properly. wrote html form to test - all is well if done so in browser:


The target script might require a certain cookie to be present or the referrer to be within the same domain as the script.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜