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.
精彩评论