Home > Backend Development > PHP Tutorial > PHP模拟赶集登陆,需要验证码有关问题

PHP模拟赶集登陆,需要验证码有关问题

WBOY
Release: 2016-06-13 12:26:26
Original
1070 people have browsed it

PHP模拟赶集登陆,需要验证码问题
用php 模拟赶集发布房源时 ,模拟登陆后,一会时间就不能登陆了,需要验证码 , 看怎么能处理下,请教下有经验的朋友 ,谢谢 !
 

<br />           $url = "https://passport.ganji.com/login.php";<br />        $data ="login_username=wangsheng6666666666&login_password=".trim(decode('bGlqaWF3YW5nc2hlbmcyMDEz'));<br />       //  $imageurl= 'https://passport.ganji.com/ajax.php?dir=captcha&module=login_captcha&nocache=1445313015271';<br />         $redata= $publish->vlogin($url,$data,$url,true);<br />        <br />      function vlogin($url,$data,$REFERER =null,$ishttps=true){ //<br />        $curl = curl_init(); // 启动一个CURL会话<br />        curl_setopt($curl, CURLOPT_URL, $url); // 要访问的地址<br />        curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); // 模拟用户使用的浏览器<br />        if(empty($REFERER))<br />        {<br />            curl_setopt($curl, CURLOPT_AUTOREFERER, 1); // 自动设置Referer<br />        }else{<br />            curl_setopt($curl, CURLOPT_REFERER, $REFERER);// 设置Referer<br />        }<br />        if($ishttps)<br />        {<br />            curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); // 对认证证书来源的检查<br />            curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2); // 从证书中检查SSL加密算法是否存在<br />        }<br />        curl_setopt($curl, CURLOPT_POST, 1); // 发送一个常规的Post请求<br />        curl_setopt($curl, CURLOPT_POSTFIELDS, $data); // Post提交的数据包<br />       // curl_setopt($curl, CURLOPT_COOKIEFILE, $this->cookie_file); // 读取上面所储存的Cookie信息<br />       // curl_setopt($curl, CURLOPT_COOKIEJAR, $this->cookie_file); // 存放Cookie信息的文件名称<br />        curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // 获取的信息以文件流的形式返回<br />        curl_setopt($curl, CURLOPT_TIMEOUT, 30); // 设置超时限制防止死循环<br />        curl_setopt($curl, CURLOPT_HEADER, 1);<br />        $tmpInfo = curl_exec($curl); // 执行操作<br />        if (curl_errno($curl)) {<br />            echo 'Errno'.curl_error($curl);<br />        }<br />       // preg_match_all('/Set-Cookie:stest=(.*)/i', $tmpInfo, $tmpInfo);<br />        curl_close($curl); // 关闭CURL会话<br />        return $tmpInfo; // 返回数据<br />    }<br />
Copy after login

请大家帮忙看看 谢谢
------解决思路----------------------
验证码 你能搞定??  估计大神来了一样搞不定
------解决思路----------------------
验证码  弹出识别 输入 是一项大工程
估计难道属于A++  识别率一般都很差
------解决思路----------------------
验 证吗,只有把它输出来 让人工输入,显人工输入,找个打码平台对接

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