Home > Backend Development > PHP Tutorial > javascript-html - PHP模拟登录公司CRM系统并进行交互,登录界面采用Ajax验证并提交的

javascript-html - PHP模拟登录公司CRM系统并进行交互,登录界面采用Ajax验证并提交的

WBOY
Release: 2016-06-06 20:20:15
Original
1462 people have browsed it

PHP模拟登录公司CRM系统并进行交互,登录界面采用Ajax验证并提交的,试过cURL没成功,页面链接:https://crm.pzoom.com
求解决方案!

function request_by_curl($remote_server, $post_string)
{

<code>$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;</code>
Copy after login
Copy after login

}

echo (request_by_curl("https://crm.pzoom.com/Index/checkform",'userid=用户名&userpwd=密码'));
?>

返回的结果是:{"state":1,"msg":"\u7528\u6237\u540d\u6216\u5bc6\u7801\u9519\u8bef\uff01"}

回复内容:

PHP模拟登录公司CRM系统并进行交互,登录界面采用Ajax验证并提交的,试过cURL没成功,页面链接:https://crm.pzoom.com
求解决方案!

function request_by_curl($remote_server, $post_string)
{

<code>$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;</code>
Copy after login
Copy after login

}

echo (request_by_curl("https://crm.pzoom.com/Index/checkform",'userid=用户名&userpwd=密码'));
?>

返回的结果是:{"state":1,"msg":"\u7528\u6237\u540d\u6216\u5bc6\u7801\u9519\u8bef\uff01"}

curl post userid=用户名&userpwd=密码/Index/checkform看看

你这个post请求的地址是https的,加上这个

<code>curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,false);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false);</code>
Copy after login

另外把你的'mypost=' .去掉

一个ajax提交 成功了跳转到/Index/selectMedia 没验证码没什么token 没见过这么简单的东西了。。

ajax提交的吧

给你翻译了一下:

<code>{"state":1,"msg":"用户名或密码错误!"}
</code>
Copy after login

到代码里去找原因吧

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template