Curl If you are doing an HTTPS analog login? What to do with it

Source: Internet
Author: User
Curl If you are doing an HTTPS analog login?
There is a website:
Https://A.com.cn/XXX

Prompt after access:


This user name and password are known, click to log in normally ~ ~ ~

But what if you should use curl to do a mock landing?? Is there a successful case?

------Solution--------------------
There's an example, but I've never verified that you can verify the validation

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);p Rint_r ( Curl_getinfo ($ch)); Curl_close ($ch); Echo '

'; Echo $output;
------Solution--------------------
  • Related Article

    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.