首页 > 开发 > PHP > 正文

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

2024-05-04 23:02:56
字体:
来源:转载
供稿:网友
  • 网站运营seo文章大全
  • 提供全面的站长运营经验及seo技术!
  • <?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" 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>

    发表评论 共有条评论
    用户名: 密码:
    验证码: 匿名发表