首頁 >後端開發 >php教程 >snoopy模拟登录为何无法登录解决办法

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

WBOY
WBOY原創
2016-06-13 10:06:15773瀏覽

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>    
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'"; ?>


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;?> 


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

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

action链接与
$snoopy->submit($submit_url,$submit_vars);$submit_url链接一致.
陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn