PHP Simulation Login to the company's CRM system and interactive, login interface using AJAX authentication and submitted, tried Curl unsuccessful, page link: https://crm.pzoom.com
Solutions!
function Request_by_curl ($remote _server, $post _string)
{
$ch = curl_init();curl_setopt($ch, CURLOPT_URL, $remote_server);curl_setopt($ch, CURLOPT_POSTFIELDS, 'mypost=' . $post_string);curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);curl_setopt($ch, CURLOPT_USERAGENT, "Jimmy's CURL Example beta");$data = curl_exec($ch);curl_close($ch);return $data;
}
Echo (Request_by_curl ("Https://crm.pzoom.com/Index/checkform", ' userid= username &userpwd= password '));
?>
The returned result is: {"state": 1, "MSG": "\u7528\u6237\u540d\u6216\u5bc6\u7801\u9519\u8bef\uff01"}
Reply content:
PHP Simulation Login to the company's CRM system and interactive, login interface using AJAX authentication and submitted, tried Curl unsuccessful, page link: https://crm.pzoom.com
Solutions!
function Request_by_curl ($remote _server, $post _string)
{
$ch = curl_init();curl_setopt($ch, CURLOPT_URL, $remote_server);curl_setopt($ch, CURLOPT_POSTFIELDS, 'mypost=' . $post_string);curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);curl_setopt($ch, CURLOPT_USERAGENT, "Jimmy's CURL Example beta");$data = curl_exec($ch);curl_close($ch);return $data;
}
Echo (Request_by_curl ("Https://crm.pzoom.com/Index/checkform", ' userid= username &userpwd= password '));
?>
The returned result is: {"state": 1, "MSG": "\u7528\u6237\u540d\u6216\u5bc6\u7801\u9519\u8bef\uff01"}
Curl Post userid=用户名&userpwd=密码
to /Index/checkform
see
The address of your post request is HTTPS, plus this
curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,false);curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false);
And get rid of you. 'mypost=' .
An AJAX submission was successful. Jump to/index/selectmedia No verification code no token has ever seen such a simple thing.
Ajax submissions.
I translated it for you:
{"state":1,"msg":"用户名或密码错误!"}
Find out why in the code.