Rumah >pembangunan bahagian belakang >tutorial php >snoopy模拟登录为何无法登录解决办法

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

WBOY
WBOYasal
2016-06-13 10:06:15774semak imbas

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链接一致.
Kenyataan:
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn