问题描述
嘿伙计们,这里是一些在b / b
网站上进行密码安全措施的代码:
<?php
session_start();
$ errorMessage ='''';
if(isset($ _ POST [''username''])&& isset($ _POST [''密码''])){
if($ _POST [''username''] ===''steven''&& $ _POST [''password'' ] ===
''crocker''){
$ _SESSION [''basic_is_logged_in''] = true;
header(' '位置:http://users.cs.cf.ac.uk/SJCrocker/search.php'');
}否则{
$ errorMessage =''对不起,错误的用户ID /密码'';
echo $ errorMessage;
}
}
?>
问题是,当我输入''steven''作为用户名和''crocker''作为
密码..没有happerns,它应该去
" http://users.cs.cf.ac.uk/SJCrocker/search.php"但它仍然在
密码输入屏幕上。然而,错误信息有效,任何想法
我出错了?
干杯
史蒂夫
Hey guys, here is some code for a password security measure in a
website:
<?php
session_start();
$errorMessage = '''';
if (isset($_POST[''username'']) && isset($_POST[''password''])) {
if ($_POST[''username''] === ''steven'' && $_POST[''password''] ===
''crocker'') {
$_SESSION[''basic_is_logged_in''] = true;
header(''Location: http://users.cs.cf.ac.uk/S.J.Crocker/search.php'');
} else {
$errorMessage = ''Sorry, wrong user id / password'';
echo $errorMessage;
}
}
?>
The problem is, when i enter ''steven'' as the username and ''crocker'' as
the password.. nothing happerns, it should go to
"http://users.cs.cf.ac.uk/S.J.Crocker/search.php" but it remains on the
password enter screen. The error message works however, any idea where
im going wrong??
Cheers
Steve
推荐答案
这篇关于密码检查的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!