curl 如果进行https的模拟登陆?该如何处理

WBOY
Release: 2016-06-13 10:11:00
Original
902 people have browsed it

curl 如果进行https的模拟登陆?
有一网站:
https://A.com.cn/XXX

访问后提示:


这个用户名和密码都是知道的,点击可以正常登陆~~~

但如果用curl应该怎么进行模拟登陆??有没有成功的案例?

------解决方案--------------------
有个例子,但我不曾验证过你可以验证验证

PHP code
$ch = curl_init("http://localhost/test.php");curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);curl_setopt($curl, CURLOPT_USERPWD, 'myuser:mypwd');// sending username and pwd.curl_setopt($curl, CURLOPT_SSL_VERIFYPEER,false);curl_setopt($curl, CURLOPT_FOLLOWLOCATION,true);curl_setopt($curl, CURLOPT_USERAGENT, 'Sample Code');curl_setopt($curl, CURLINFO_HEADER_OUT, true);$output = curl_exec($ch);print_r(curl_getinfo($ch));curl_close($ch);echo '<br><br>';echo $output;<br><font color="#e78608">------解决方案--------------------</font><br>curl的header搞搞呢?<div class="clear">
                 
              
              
        
            </div>
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!