Php simulated login with account and password
http://112.78.104.13
Account: zm1000, password a123456. I want to simulate login using php, but it is always unavailable. is the submission method incorrect? Please help me!
You can also extract the cookie, but it does not seem to support the cookie.
Reply to discussion (solution)
1. http: // 112.78.104.13 is the framework page. Contains public variables and functions
2. the logon frame is http: // 112.78.104.13/app/member.
3. the target page of the form is http: // 112.78.104.13/app/member/login. php.
4. return after logon
《script》top.uid = '360eae3m12904263l134939190';top.langx = 'zh-tw';top.liveid = 'cbcfc6cdcec29bcdccc9cd'top.casino = 'SI2';top.hot_game = '';top.hasLogin = 'login';《script》《script》window.location.href = 'http://112.78.104.13/app/member/FT_index.php?mtype=3&uid=360eae3m12904263l134939190&langx=zh-tw';《script》
Only php can do this. although the jump target page can be analyzed, the data is generated by js. Only page framework is available
Reference Code
$url = 'http://112.78.104.13/app/member';$url1 = '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 to simulate submission only for the presentation
1. http: // 112.78.104.13 is the framework page. Contains public variables and functions
2. the logon frame is http: // 112.78.104.13/app/member.
3. the target page of the form is http: // 112.78.104.13/app/member/login. php.
4. return after logon
《script》top.uid = '360eae3m12904263l134939190';top.langx = 'zh-tw';top.liveid = 'cbcfc6cdcec29bcdccc9cd'top.casino = 'SI2';top.hot_game = '';top.hasLogin = 'login';《script》《script》window.location.href = 'http://112.78.104.13/app/member/FT_index.php?mtype=3&uid=360eae3m12904263l134939190&langx=zh-tw';《script》
Only php can do this. although the jump target page can be analyzed, the data is generated by js. Only page framework is available
Reference Code
$url = 'http://112.78.104.13/app/member';$url1 = '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 to simulate submission only for the presentation
Can I get the whole page of data from an address? I want to collect the results on this page.
I have already said, "data is generated by js." naturally, php cannot catch it.
I have already said, "data is generated by js." naturally, php cannot catch it.
Will you collect this data and write it to the database? open a price,
There is a file, so there is a reference for writing to the database. I am happy to hear you talk about the price and time!
It is not impossible to use PHP to capture JS data. if the data is discovered by the other party, the maintenance cost of this program will increase.
Its ?,? Generally ???, But ??? West want ??? This is done by someone.