Home  >  Article  >  Backend Development  >  请教下带验证码的网站怎么用php curl模拟登陆呢?

请教下带验证码的网站怎么用php curl模拟登陆呢?

WBOY
WBOYOriginal
2016-06-02 11:28:20918browse

验证码phpcurl

www.xianbao5.com 这个网站用CURL post登录 谁会能教教我吗?

主要是怎么获取这个网站的验证码?人工输入也可以

我在抓包工具找到了验证码的网址,是 http://www.xianbao5.com/misc.php?mod=seccode&update=11212&idhash=cSB0PJ9T 但是不知道为什么直接在浏览器访问却没有东西!

<code> <?php header("content-Type: text/html; charset=GBK");$cookie_file = tempnam('./', 'cookie');$login_url="www.xianbao5.com/member.php?mod=logging&action=login";$ch=curl_init($login_url);curl_setopt($ch,CURLOPT_HEADER,0);curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);curl_setopt($ch,CURLOPT_COOKIEJAR,$cookie_file); curl_setopt($ch,CURLOPT_COOKIEFILE,$cookie_file); curl_setopt($ch,CURLOPT_REFERER ,"www.xianbao5.com");$contents = curl_exec($ch);curl_close($ch);echo $contents;?></code>

我是这样写的不行,验证码出不来,谁能帮我改改?

Statement:
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