国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > PHP > 正文

PHP實例程序:用PHP制作登錄頁面程序

2024-05-04 23:02:56
字體:
來源:轉載
供稿:網友

<?php
//這個腳本是用來給用戶輸入口令,并判斷口令是否正確的。
//如果正確則轉到歡迎頁面。
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')";
    $[email protected]_query($query,$dbconnect);
    if ($[email protected]_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="對不起,您沒有訂票的權限!";
        }
    }
    else{
        $error_message="錯誤!用戶名錯,或口令錯。請重新輸入。";
    }
    $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="返回首頁" 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>

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 定兴县| 顺义区| 和静县| 邢台市| 延寿县| 靖边县| 双牌县| 泽州县| 清丰县| 肇庆市| 新野县| 商丘市| 肃宁县| 曲松县| 利川市| 铁岭市| 陇川县| 兴安盟| 连平县| 宁武县| 建宁县| 湟中县| 沛县| 许昌县| 双桥区| 沙雅县| 林甸县| 华亭县| 定州市| 容城县| 庆城县| 禹州市| 金秀| 墨竹工卡县| 弋阳县| 三都| 齐河县| 元阳县| 云林县| 五台县| 德清县|