Some people often ask questions about simulated login. In fact, the principle is very simple. you just need to save the SessionID. Today, it took an hour to write a function for your reference, the header information returned by the website. Source code :? Php... some people often ask questions about simulated login. In fact, the principle is very simple. you just need to save the SessionID. Today, it took an hour to write a function for your reference, the header information returned by the website.
Source code:
"; Echo $ response ['sessid']."
"; If (preg_match ('/error. php/I', $ response ['location']) {echo" login failed
";} Else {echo" login successful
"; // The user cannot be accessed. php, because the sessid parameter $ response = GetWebContent ("localhost", "GET/user. php HTTP/1.0 ",'', ''); echo $ response ['location']."
"; // Result: error. php? Errcode = 2 // you can access the user. php $ response = GetWebContent ("localhost", "GET/user. php HTTP/1.0 ",'', $ response ['sessid']); echo $ response ['location']."
"; // Result: user. php}?>