Home > Backend Development > PHP Tutorial > snoopy模拟登录为何无法登录解决办法

snoopy模拟登录为何无法登录解决办法

WBOY
Release: 2016-06-13 10:06:15
Original
778 people have browsed it

snoopy模拟登录为何无法登录
自己写的要登录的系统

PHP code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>testlogin</title> <br><center>testlogin</center><br>    
Copy after login
id:
pass:



PHP code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--><?php $loginId = $_POST['loginId'];$loginPass = $_POST['loginPass'];if($loginId == "aaa" && $loginPass == "123")  echo "welcome!";else  echo "<script language=javascript>alert('fail!');window.location='login.php'"; ?>
Copy after login


snoopy模拟登录代码
PHP code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->   <title> New Document </title>  <?phpinclude "Snoopy.class.php";$snoopy = new Snoopy;$submit_url = "http://127.0.0.1/testlogin/login.php"; $submit_vars["loginId"] = "aaa"; //可以登录的密码为aaa,123$submit_vars["loginPass"] = "123";//$submit_vars["loginSubmit"] = "登陆";$snoopy->submit($submit_url,$submit_vars);echo $snoopy->results;?> 
Copy after login


问题1:上面的代码无法登录,哪里出了问题呢,我的php环境是简捷包appserv-win32-2.5.10,参数默认

------解决方案--------------------
注意你的

action链接与
$snoopy->submit($submit_url,$submit_vars);$submit_url链接一致.
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template