PHP Get Cookie Demo Login _php Tutorial

Source: Internet
Author: User
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 ...

  • 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.