Simulate POST login with PHP_CURL1. CURL introduction: CURL allows you to use various types of protocols to connect and communicate with various servers. Currently, the supported protocols include http, https, ftp, gopher, telnet, dict, file,
CURL introduction:
CURL allows you to use various protocols to connect and communicate with various servers. Currently, the supported protocols include http, https, ftp, gopher, telnet, dict, file, and ldap, it also supports HTTPS authentication, http post, http put, and FTP upload (this can also be completed through the FTP extension of PHP) HTTP form-based Upload, proxy, cookies, user name + password authentication. (From manual)
In short, CURL is very powerful and can implement functions that many file_get_contents functions cannot implement.
I will not go into details about the principles here.
CURL simulated login:
First, create two files in your project: login. php (submit for login), validate. php (verify), and code list:
Login. php
Validate. php
Login successful. "login successful" is displayed in JS. login failed, and "login failed" is displayed in JS ".
Note: Original article, reproduced please indicate the source: http://blog.csdn.net/liruxing1715/article/details/18551621
CURL allows you to use various protocols to connect and communicate with various servers. Currently, the supported protocols include: http, https, ftp, gopher, telnet, dict, file ,...