내 세션을 설정하기 위해 다음을 수행합니다. 에코가 나타나기 때문에 작동합니다. 하지만 다음 페이지 나 다른 세션으로 갈 때 세션이 없습니다. 내가 도대체 뭘 잘못하고있는 겁니까? 나는 이러한 세션 작업을 다음 얻기 위해 노력하고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') ;
}
?>
업데이트 :
대문자 세션이 작동하지만 지금은 세션 i가 logout.php를 사용하여 파괴이 arent
<?php
session_start();
session_destroy();
header("location: home.html");
?>
이 작동하지만 새 문제가 있습니다 – Anicho
@Anicho 내 업데이트를 참조하십시오 – PeeHaa
감사 repwhoringpeehaa – Anicho