PHP simulates logon to the company's CRM system and interacts with each other. The logon interface adopts Ajax for verification and submission. The cURL is not successful. The webpage link: crm.pzoom.com to find a solution! & Amp; lt ;? Phpfunctionrequest_by_curl ($ remote_server, $ post_string) {code ...}... PHP simulation login company CRM system and interaction, login interface using Ajax verification and submit, tried cURL failed, Page Link: https://crm.pzoom.com
Find a solution!
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 '));
?>
Returned result: {"state": 1, "msg": "\ u7528 \ u6237 \ u540d \ u6216 \ u5bc6 \ u7801 \ u9519 \ u8bef \ uff01 "}
Reply content:
PHP simulation login company CRM system and interaction, login interface using Ajax verification and submit, tried cURL failed, Page Link: https://crm.pzoom.com
Find a solution!
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 '));
?>
Returned result: {"state": 1, "msg": "\ u7528 \ u6237 \ u540d \ u6216 \ u5bc6 \ u7801 \ u9519 \ u8bef \ uff01 "}
Curl postUserid = username & userpwd = Password
To/Index/checkform
Look
The address of your post request is https.
curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,false);curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false);
In addition'mypost=' .
Remove
An ajax request is successfully submitted to/Index/selectMedia. There is no verification code, and there is no token ..
Submitted by ajax
Translated for you:
{"State": 1, "msg": "The user name or password is incorrect! "}
Find the reason in the code.