由于某些原因我无法登录,每次我打开测试文件密码存在时,我都会放置一个 echo-test 并标记它,但代码总是运行else而不是if。
kernel-login-logout.php 是这样的:
<?php
$formusername = $_GET["username"];
$formpasswd = $_GET["passwd"];
$passwdget = file_get_contents( "users/$formusername/passwd/thepasswd.txt" );
if ($formpasswd == $passwdget)
{
setcookie("libusername", $formusername,time() + (86400 * 7));
setcookie("libpasswd", $formpasswd,time() + (86400 * 7));
}
else
{
echo ("Password not found<br>");
}
?>
<?php echo ($passwdget); ?><br>
<?php echo ($formpasswd); ?>
网址:
kernel-login-logout.php?username=userdokimi&passwd=testpasswd & login=Login
输出:
Password not found
testpasswd
testpasswd