Javascript-html-php simulates and interacts with the company's CRM system, and the login interface is validated and submitted by Ajax

Source: Internet
Author: User
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.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.