«

session判断

Genius 发布于 阅读:502 PHP技术


session_start();
if  (isset( $_SESSION [ 'admin' ]) && ! empty ( $_SESSION [ 'admin' ])) {
     echo "<span></span>";
} else {
     echo "<script language=javascript>alert('你还没登录!');location='../center/login.php';</script>";
}
 session_start();
$_SESSION["admin"]=$id;