PHP Login with account password

Source: Internet
Author: User
http://112.78.104.13


Account: zm1000, password a123456, I want to use PHP simulation login, but always not, is not the way to submit? Ask the great God to answer!

Or extract a cookie, but it doesn't seem to support cookies.


Reply to discussion (solution)

1, http://112.78.104.13 is the frame page. Contains public variables and functions
2. Frame with login frame is Http://112.78.104.13/app/member
3. Form target page is http://112.78.104.13/app/member/login.php
4. Return after Login

PHP only can be done here, although the target page can be precipitated jump, but the data is generated by JS. can only get the page frame

Reference Code
$url = ' Http://112.78.104.13/app/member '; $url 1 = ' http://112.78.104.13/app/member/login.php '; $d = Array (' username ' = > ' zm1000 ', ' passwd ' = ' a123456 ')//echo file_get_contents ($url);//print_r (Get_headers ($url)); Echo PostData ($ URL1, $d), function PostData ($url, $data) {    $opts = array ('        http ' = = Array (' method ' = ' "            POST '),            ' Header ' = ' content-type:application/x-www-form-urlencoded ',            ' user_agent ' = ' $_server[' http_user_agent '] ,            ' content ' = Http_build_query ($data)        )        );    $context = Stream_context_create ($opts);    $result = File_get_contents ($url, False, $context);    return $result;}


Use File_get _contents impersonation submission for demonstration only

1, http://112.78.104.13 is the frame page. Contains public variables and functions
2. Frame with login frame is Http://112.78.104.13/app/member
3. Form target page is http://112.78.104.13/app/member/login.php
4. Return after Login

PHP only can be done here, although the target page can be precipitated jump, but the data is generated by JS. can only get the page frame

Reference Code
$url = ' Http://112.78.104.13/app/member '; $url 1 = ' http://112.78.104.13/app/member/login.php '; $d = Array (' username ' = > ' zm1000 ', ' passwd ' = ' a123456 ')//echo file_get_contents ($url);//print_r (Get_headers ($url)); Echo PostData ($ URL1, $d), function PostData ($url, $data) {    $opts = array ('        http ' = = Array (' method ' = ' "            POST '),            ' Header ' = ' content-type:application/x-www-form-urlencoded ',            ' user_agent ' = ' $_server[' http_user_agent '] ,            ' content ' = Http_build_query ($data)        )        );    $context = Stream_context_create ($opts);    $result = File_get_contents ($url, False, $context);    return $result;}


Use File_get _contents impersonation submission for demonstration only



Finally can give an address to get full page data, I want to collect the results on this page

I've already said, "data is generated by JS," and it's natural that PHP can't catch it.

I've already said, "data is generated by JS," and it's natural that PHP can't catch it.



Brother, will you collect this data and write it to the database, and open a price,
Originally there is a file, so write to the database section has reference. You directly say the price and time, I am a happy person!

JS data with PHP catch is not impossible, but was found by the other side, the maintenance cost of the program will increase

It is generally not???, but??? West to??? Only people do it.

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