keywords:
CURL
Cookie Curlopt_cookiejar curlopt_cookiefile Demo Login PHP
Author:Square Double Studio
Original: http://www.cnblogs.com/txw1958/p/php-cookie-login.html
I. Defining a cookie Storage path
Absolute path must be used
< span="">< span="">(< span="">)." /pic.cookie ";
Second, access to cookies
Depositing a cookie into a file
< span="">= "http://1.2.3.4/" < span=""> < span=""> < span=""> = < span=""> < span=""> , Curlopt_header , 0 < span=""> < span=""> < span=""> < span=""> < span="">< span="">< span="">< span="">< span=""> < span="">= curl_exec(< span="">); < span=""> < span="">
Third, the simulation browser to obtain the verification code
The server verification code is a vulnerability, you can specify
Take out the cookie and submit it to the server to let the server think it is the browser to open the landing page
< span="">< span="">=,< span="">curlopt_url, ' http://1.2.3.4/getCheckpic.action?rand=6836.185874812305 ' < span=""> < span=""> , < span="">curlopt_ < span=""> < span=""> HEADER, 0< span="">< span="">, Curlopt_returntransfer, 1 < span=""> < span=""> < span="">= curl_exec (< span="">);< span="">
Iv. Post Submission
< span="">= "Name=2&usertype=1&passwd=asdf&logintype=1&rand=6836&imagefield.x=25&imagefield.y=7" < span=""> =,< span="">curlopt_url,"http://1.2.3.4/ < span=""> < span=""> < span=""> loginstudent.action " < span=""> < span=""> < span=""> < span=""> , curlopt_returntransfer,1 < span=""> < span=""> < span=""> < span="">< span="">< span="">< span="">< span="">= Curl_exec< span="">(< span="">);< span="">
Five, to the specified page to obtain data
< span="">< span="">= < span=""> , Curlopt_url, "http://1.2.3.4/accountcardUser.action" < span=""> < span=""> < span=""> , < span="">curlopt_header , 0 < span=""> , curlopt_returntransfer,0 < span=""> < span=""> < span=""> < span=""> =curl_exec ( < span=""> < span=""> < span=""> < span=""> < span=""> < span="">curl_close (); < span=""> < span="">
http://www.bkjia.com/PHPjc/440144.html www.bkjia.com true http://www.bkjia.com/PHPjc/440144.html techarticle Keywords: CURL cookiecurlopt_cookiejarcurlopt_cookiefile demo Login PHP Author: Fang Times Studio Original: http://www.cnblogs.com/txw1958/p/ Php-cookie-login.html One, define CO ...