PHP Login with account password
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.
------to solve the idea----------------------
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 ($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