我正在创建一个网页,测试部分网页的想法。我想了解如何进行会话保护页面。我已经密码保护了页面,但任何人都可以通过输入url来访问页面。我想保护我的页面,所以没有人能做到这一点。我有三个页面:index.html,它具有发送password.php和password.php的形式,它使用“if statments”确保密码和用户名正确(这里是“if statment”) 。会话保护
if ($username == 'mgmb99'){
if ($password == 'mgmb91mas'){
header('Location: youhere.php');
} else {
echo 'your username or password is wrong.<a href="http://www.passwordtest.comze.com"> go back to login page </a>';
}} else {
echo 'your username or password is wrong.<a href="http://www.passwordtest.comze.com"> go back to login page </a>';
};
,并且是该页面,一旦你登录的youhere.php