PHP Use account password to simulate landing solution

Source: Internet
Author: User
PHP Login with account password

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.
------to solve the idea----------------------
1, is the frame page. Contains public variables and functions
2. Frame with login frame is Http://
3. Form target page is
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:// ';
$url 1 = ' ';
$d = Array (' username ' = ' zm1000 ', ' passwd ' = ' a123456 ');

Echo file_get_contents ($url);
Print_r (Get_headers ($url));

Echo PostData ($url 1, $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
  • 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: 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.