实例:PHP判断用户是否正确登录转到欢迎界面


//这个页面首先判断用户是否正确登录,如未登录,就转到登录页面。

<?PHP
session_start();
if((!$user_id)or(!$user_array[ticket_day])or(!$user_array[ticket_num])){
Header("Location: login.php3");
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>欢迎使用南京站订票系统</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <link rel="stylesheet" type="text/CSS技巧">CSS" href="../include/njz_common.css"> </head>
<body>
<p> </p>
<table width="500" border="1" cellspacing="0" cellpadding="0" align="center" bordercolor="#CCCCCC">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr bgcolor="#999999">
<td>
<div align="center"><font size="4" color="#FFFFFF">欢迎您 <?php echo $user_name; ?></font></div> </td> </tr> </table> <br> <table width="400" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td><font color="#3333CC">公告栏:</font></td> </tr> <tr> <td>  今日无公告</td> </tr> </table> <br> <br> <table width="400" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td> <div align="center"><a href="reserve_ticket.php3">网上订票</a> <a href="test1.php3">订单查询</a> <a href="test2.php3">口令修改</a> 订票帮助 <a href="login.php3?logout=1">退出登录</a> </div>
</td>
</tr>
</table>
<br>
</td>
</tr>
</table>
<p> </p>
<?php
include("../footer.php");
?>
</body>
</html>

本文作者:
« 
» 
快速导航

Copyright © 2016 phpStudy | 豫ICP备2021030365号-3