<?php session_start(); ?>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<?
//$_SESSION['username'];
if($_SESSION['username'] == null){ // session = null (未登入)
echo '您無權限觀看此頁面!';
echo '<meta http-equiv=REFRESH CONTENT=2;url=login.php>';
}else{ // session != null (已經登入)
echo "Hello, ".$_SESSION['username'];
}
?> |