欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

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

 更新時(shí)間:2008年07月25日 08:52:25   作者:  
這個(gè)腳本是用來給用戶輸入口令,并判斷口令是否正確的。 如果正確則轉(zhuǎn)到歡迎頁面。
<?php
//這個(gè)腳本是用來給用戶輸入口令,并判斷口令是否正確的。
//如果正確則轉(zhuǎn)到歡迎頁面。
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="返回首頁" 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)文章

  • apache+php+mysql安裝配置方法小結(jié)

    apache+php+mysql安裝配置方法小結(jié)

    以前用一直用PHP XAMPP 軟件站集成軟件包開發(fā)PHP項(xiàng)目,不知道單獨(dú)安裝各個(gè)模塊會(huì)有那么多問題,這次花了大半天才將環(huán)境搭建好。
    2010-08-08
  • php獲取微信基礎(chǔ)接口憑證Access_token

    php獲取微信基礎(chǔ)接口憑證Access_token

    這篇文章主要為大家詳細(xì)介紹了php獲取微信基礎(chǔ)接口憑證Access_token,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2018-08-08
  • php自定義截取中文字符串-utf8版

    php自定義截取中文字符串-utf8版

    本文主要介紹了php自定義截取中文字符串的方法,具有很好的參考價(jià)值,下面跟著小編一起來看下吧
    2017-02-02
  • PHP連接MySQL數(shù)據(jù)庫操作代碼實(shí)例解析

    PHP連接MySQL數(shù)據(jù)庫操作代碼實(shí)例解析

    這篇文章主要介紹了PHP連接MySQL數(shù)據(jù)庫操作代碼實(shí)例解析,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下
    2020-07-07
  • 10 個(gè)經(jīng)典PHP函數(shù)

    10 個(gè)經(jīng)典PHP函數(shù)

    這篇文章主要介紹了php中的10個(gè)比較經(jīng)典的函數(shù),不太常見,可以滿足有特殊需求的朋友
    2013-10-10
  • PHP中數(shù)組的三種排序方法分享

    PHP中數(shù)組的三種排序方法分享

    PHP中數(shù)組的三種排序方法,主要包括冒泡排序法、選擇排序法、插入排序法,需要的朋友可以參考下
    2012-05-05
  • Admin generator, filters and I18n

    Admin generator, filters and I18n

    You need to modify your EntityFormFilter (where Entity is your object class - Article, Book, etc.).
    2011-10-10
  • php部分常見問題總結(jié)

    php部分常見問題總結(jié)

    php常見問題解決集錦,主要包括php的運(yùn)行方法等小技巧
    2008-03-03
  • php抓取頁面與代碼解析 推薦

    php抓取頁面與代碼解析 推薦

    在做一些天氣預(yù)報(bào)或者RSS訂閱的程序時(shí),往往需要抓取非本地文件,一般情況下都是利用php模擬瀏覽器的訪問,通過http請(qǐng)求訪問url地址,然后得到html源代碼或者xml數(shù)據(jù)。
    2010-07-07
  • php中文語義分析實(shí)現(xiàn)方法示例

    php中文語義分析實(shí)現(xiàn)方法示例

    這篇文章主要介紹了php中文語義分析實(shí)現(xiàn)方法,結(jié)合實(shí)例形式分析了PHP基于BosonNLP擴(kuò)展實(shí)現(xiàn)中文語義分析的具體操作步驟與相關(guān)實(shí)現(xiàn)技巧,需要的朋友可以參考下
    2019-09-09

最新評(píng)論