What if curl performs https simulated login? After visiting a website A.com. cnXXX, the system prompts that the user name and password are all known. you can click here to log on to the website ~~~ But how should I simulate login with curl ?? Are there any successful cases? ------ Solution ------------------ There is an example, but I have never verified that you can verify PHPcode $ chcurl_init (if curl performs https simulated login?
There is a website:
Https://A.com.cn/XXX
Prompt after access:
This user name and password are all known. you can log on to the console by clicking here ~~~
But how should I simulate login with curl ?? Are there any successful cases?
------ Solution --------------------
There is an example, but I have never verified that you can verify
PHP code
$ Ch = curl_init ("http: // localhost/test. php "); curl_setopt ($ ch, batch, 1); curl_setopt ($ curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); curl_setopt ($ curl, CURLOPT_USERPWD, 'myuser: mypwd '); // sending username and pwd. curl_setopt ($ curl, expires, false); curl_setopt ($ curl, CURLOPT_FOLLOWLOCATION, true); curl_setopt ($ curl, CURLOPT_USERAGENT, 'sample code'); curl_setopt ($ curl, expires, true); $ output = curl_exec ($ ch); print_r (curl_getinfo ($ ch); curl_close ($ ch); echo'
'; Echo $ output;
------ Solution --------------------
What about the curl header?