PHP Curl PHP Curl
I want to simulate this site's answer: http://zsjs.kaiwind.com/kf/html/index.html
He is landing on the above page, then to the new page to answer questions, the answer is all finished and actually, allow the submission.
He is the AJAX submission, all JS authentication passed, back to the background to send AJAX requests, complete the page.
He sent the data is not complex, but in the simulation of his data sent, but always error, the following posted code and error prompts, hope that the great God to save.
Code:
Curl Request section:
Executive section:
UrlEncode ($phone), ' area ' =>urlencode ($area)), $GLOBALS [' cookie_file '] = $cookie _jar;require_once ('./ Functions.php '); $url = ' http://zsjs.kaiwind.com/kf/html/index.html ';//Vget ($url);//exit (); $browsers = Array ("ACC Ept "=" text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 "," accept-encoding "=" gzip ", Deflat E "," accept-language "=" zh-cn,zh;q=0.8,en-us;q=0.5,en;q=0.3 "," cache-control "=" max-age=0 "," Connection "= > "Keep-alive", "Content-type" and "application/x-www-form-urlencoded",//"Cookie" = "cnzzdata199524=cnzz_ Eid%3d713570903-1381646309-http%253a%252f%252fzsjs.kaiwind.com%26ntime%3d1381738758%26cnzz_a%3d0%26retime% 3d1381738758499%26sin%3d%26ltime%3d1381738758499%26rtime%3d1 "," Host "=" zsjs.kaiwind.com "," user-agent "and" = " mozilla/5.0 (Windows NT 6.1; rv:24.0) gecko/20100101 firefox/24.0 "); $url = ' http://zsjs.kaiwind.com/kf/kfcheck.php ';d UMP (Vpost ($url, $data); exit (); $url = ' http://zsjs.kaiwind.com/kf/kfsub.php ';d UMP (Vpost ($url, $data));? >
Results returned by the page:
String (90) "Request
Your Browser sent an invalid request.
"
Reply to discussion (solution)
Cookie on the last line,?
curl_setopt ($curl, curlopt_useragent, $_server[' http_user_agent '); Simulating the browser used by the user
Let's try to comment this out.