我想檢查會話是否設置。而不是在所有的頁面檢查,我想其中包含的所有文件我如何檢查會話是否設置或不是從標題視圖
一個觀點叫的header.php檢查這個我的頭視圖代碼是
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid" style="background: #1A7A7B">
<div class="navbar-header float-left">
<a href="http://www.rafeeque.zaliyo.in/smp1/index.php/admin/admin_home"><h2 align="center" style="float:left;">School Management System</h2></a>
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".user-collapse">
<span class="glyphicon glyphicon-user"></span>
</button>
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".menu-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="collapse navbar-collapse user-collapse">
<ul class="nav navbar-nav navbar-right navbar-collapse">
<li><a href="#"><span class="glyphicon glyphicon-user ">Profile</span></a></li>
<li><a href="#"><span class="glyphicon glyphicon-off">Logout</span></a></li>
</ul>
</div>
</div>
</nav>
如何做到這一點。在此先感謝
'if(isset($ _ SESSION [...]))' –
這可能有助於: http://stackoverflow.com/questions/18286972/check-if-session-doesnt-exist-php –