我按照以下步骤设置了会话,因为echo会出现,所以这是有效的。但是当我进入下一页或另一页时,会话不在那里?我究竟做错了什么?正在丢失Php会话
$session_start();
if ($username==$dbusername&&$password==$dbpassword)
{
echo"<b>Login Successful</b><br><a href='systemadmin.html'><br>Click here to access the <strong>System Admin Page</strong></a>";
$_session['username']=$dbusername;
if($username == "admin")
{
$_session['admin'] = true;
}
我试图让下面的这些会议的工作:
<?php
session_start();
if($_session['admin'] == true)
{
// do nothing
}else{
header('Location: home.html') ;
}
?>
更新:
大写会议工作,但现在的会话了摧毁的arent当我使用logout.php
<?php
session_start();
session_destroy();
header("location: home.html");
?>
这个工程,但我有一个新问题 – Anicho
@Anicho看到我的更新 – PeeHaa
谢谢repwhoringpeehaa – Anicho