最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

PHP4中session登錄頁(yè)面的應(yīng)用

 更新時(shí)間:2008年07月25日 08:52:25   作者:  
這個(gè)腳本是用來(lái)給用戶輸入口令,并判斷口令是否正確的。 如果正確則轉(zhuǎn)到歡迎頁(yè)面。
<?php
//這個(gè)腳本是用來(lái)給用戶輸入口令,并判斷口令是否正確的。
//如果正確則轉(zhuǎn)到歡迎頁(yè)面。
if ($login){
    include("../include/config.inc.php3");
    session_start();
    $right_enter='0';
    $query="select * from user_define where user_login='$user_login' and user_pass=password('$user_pass')";
    $result=@mysql_query($query,$dbconnect);
    if ($user_array=@mysql_fetch_array($result)){
        $user_id=$user_array[user_id];
        $user_name=$user_array[user_info];
        session_register("user_id");
        session_register("user_name");
        session_register("user_array");
        if(($user_array[ticket_day]) and ($user_array[ticket_num])){
            $right_enter='1';
        }
        else{
            $error_message="對(duì)不起,您沒有訂票的權(quán)限!";
        }
    }
    else{
        $error_message="錯(cuò)誤!用戶名錯(cuò),或口令錯(cuò)。請(qǐng)重新輸入。";
    }
    $log_time=date("Y-m-d H:i:s");
    $query="insert into log_record (log_time,user_login,remote_addr,right_enter,enter_function) values ('$log_time','$user_login','$REMOTE_ADDR','$right_enter','1')";
    @mysql_query($query,$dbconnect);
    if($right_enter){
        Header("Location: welcome_reserve.php3");
        exit;
    }
}
if($logout){
    session_start();
    session_unregister("user_id");
    session_unregister("user_name");
    session_unregister("user_array");
}
?>
<!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>

<form name="form1" method="post" action="<?php echo $PHP_SELF; ?>" >
  <table width="289" border="1" cellspacing="0" cellpadding="1" bordercolor="#999999" align="center">
    <tr bgcolor="#999999"> 
      <td> 
        <div align="center"><font color="#FFFFFF" size="4">用戶登錄</font></div>
      </td>
    </tr>
    <tr>
      <td>
        <table width="267" border="0" cellspacing="0" cellpadding="5" align="center">
          <tr> 
            <td width="94"> 
              <div align="right">用戶:</div>
            </td>
            <td width="169"> 
              <input type="text" name="user_login" size="16" maxlength="16" value="<?php echo $user_login; ?>">
            </td>
          </tr>
          <tr> 
            <td width="94"> 
              <div align="right">口令:</div>
            </td>
            <td width="169"> 
              <input type="password" name="user_pass" size="16" maxlength="16">
            </td>
          </tr>
          <tr> 
            <td colspan="2"> 
              <div align="center"> 
                <input type="submit" name="login" value=" 登  錄 ">
                <input type="button" name="return_index" value="返回首頁(yè)" onClick="form1.action='../include/goto_page.php3?dist_page=../main.php3';form1.submit();return;">
              </div>
            </td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
</form>
<?php
if($error_message) echo "<center><font color='#ff0000'>$error_message</font></center>";
?>
<SCRIPT language="JavaScript">document.form1.user_login.focus();
</SCRIPT>
<p> </p>
<?php include("../footer.php3"); ?>
</body>
</html>

相關(guān)文章

  • php中防止惡意刷新頁(yè)面的代碼小結(jié)

    php中防止惡意刷新頁(yè)面的代碼小結(jié)

    惡意刷新就是不停的去刷新提交頁(yè)面,導(dǎo)致大量無(wú)效數(shù)據(jù)了,下面我們來(lái)總結(jié)一下php 防止惡意刷新頁(yè)面方法總結(jié)
    2012-10-10
  • 最新評(píng)論

    建德市| 得荣县| 松溪县| 城固县| 宿松县| 东台市| 永和县| 鄂州市| 闵行区| 新源县| 清水河县| 大荔县| 田林县| 金寨县| 巴林左旗| 泰和县| 县级市| 新安县| 景谷| 津市市| 晋宁县| 上杭县| 同江市| 普定县| 宜兰市| 涟水县| 炎陵县| 贵州省| 湘潭市| 大庆市| 海盐县| 松阳县| 石家庄市| 灵璧县| 双峰县| 晴隆县| 南丰县| 应用必备| 樟树市| 绩溪县| 留坝县|