Snoopy simulated logon PHPcode & lt; HTML & gt; & lt; HEAD & gt; & lt; TITLE & gt; NewDocument & lt;/TITLE & gt; & lt; metahttp-equiv = & quot; Content-Type & quot; content = & quot; te snoopy simulated logon
PHP code
New Document
Fetchform ("http://www.phpx.com/happy/logging.php? Action = login "); echo $ snoopy-> results ."
"; */$ Submit_url =" http://www.phpx.com/happy/logging.php? Action = login "; $ submit_vars [" cookietime "] =" 2592000 "; $ submit_vars [" loginfield "] =" username "; $ submit_vars ["username"] = "your username"; // your username $ submit_vars ["password"] = "your password "; // your password $ submit_vars ["questionid"] = "0"; $ submit_vars ["answer"] = ""; $ submit_vars ["loginsubmit"] = "login "; // $ submit_vars ["loginsubmit"] = "dl"; // Yes // $ submit_vars ["loginsubmit"] = ""; // no // Question 1: why should I add the above sentence: $ submit_vars ["loginsubmit"] = "Login", and "login" can be changed to any word, but "" cannot $ snoopy-> submit ($ submit_url, $ submit_vars); echo $ snoopy-> results; // Question 2: After successful logon, the system jumps to http: // 127.0.0.1/snoopy/index. php?>
------ Solution --------------------
1. this field is a hidden field of the form, such: .
2. this is determined by the processing script after the form is submitted. as you said, it will be used for later judgment! Empty ($ _ POST [loginsubmit]) is not a Snoopy problem.
3. $ snoopy-> submit ($ submit_url, $ submit_vars );
$ Snoopy-> fetch ('http: // www.phpx.com/happy/index.php'); // directly capture the final page
Echo $ snoopy-> results;