session判断页面是否已经登录的问题

01.session_start();  
02.  
03.isset(  
04.SESSION['username'])?include("checklogin.php"):session_destroy();  
05.  
06.?>  
07.  
08.欢迎页面,说明已经登录进来  
09.  
10.<?php  
11.  
12.if (isset(GET['out'])){  
13.GET['out']=='index'?session_destroy():'';  
14.  
15.}  
16.  
17.?>  
18.  
19.<a href='?out=index'>退出</a>  
20.  
21.checklogin.php页面是<?php  
22.  
23.//session_start();  
01.if (empty(SESSION['username'])){  
02.  
03. echo '你的js提示'; session_destroy();  

 

posted @ 2013-05-21 10:41  王翔(kingfly)  阅读(849)  评论(0编辑  收藏  举报