茄子在线看片免费人成视频,午夜福利精品a在线观看,国产高清自产拍在线观看,久久综合久久狠狠综合

    <s id="ddbnn"></s>
  • <sub id="ddbnn"><ol id="ddbnn"></ol></sub>

  • <legend id="ddbnn"></legend><s id="ddbnn"></s>

    asp用戶注冊示例代碼
    來源:易賢網 閱讀:1090 次 日期:2014-08-22 15:42:20
    溫馨提示:易賢網小編為您整理了“asp用戶注冊示例代碼”,方便廣大網友查閱!

    asp用戶注冊示例代碼:

    數據庫設計:

    表名:userinfo

    字段名 類型/長度 說明

    id 自動編號 用戶ID

    username text/16 用戶名

    password text/32 MD5 32位加密

    addtime 時間日期 注冊時間

    代碼如下:

    <%

    'asp教程用戶注冊示例

    'http://www.asp.org.cn

    dim db,conn,myconn

    db="asporgcn.mdb" '數據庫文件相對路徑

    Set Conn = Server.CreateObject("ADODB.Connection") '創(chuàng)建對象實例

    myconn="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(""&db&"")

    Conn.Open MyConn

    if request("submit")<>"" then '用戶點擊提交按鈕

    username=request("username")

    password=request("password")

    password2=request("password2")

    if password<>password2 then

    response.write("<script>alert('兩次輸入的密碼不對');window.history.back();</script>")

    response.end() '結束運行

    end if

    set rs=server.CreateObject("adodb.recordset")

    sql="select count(0) from userinfo where username='"&username&"'"

    rs.open sql,conn,1,1

    if rs(0)>0 then '判斷用戶名是否已經注冊

    response.write("<script>alert('用戶名已經存在');window.history.back();</script>")

    response.end() '結束運行

    else

    'response.write "insert into userinfo(username,password) values('"&username&"','"&password&"')"

    conn.execute("insert into userinfo([username],[password]) values('"&username&"','"&password&"')") '添加到數據庫注冊完成,password是ACCESS中的保留關鍵字。保留關鍵字用[]括起來就不會出錯。

    response.write("<script>alert('注冊成功!');window.history.back();</script>")

    end if

    rs.close

    set rs=nothing '使用完RS后一定要記得關閉與釋放,否則占用服務器資源,在ASP程序面試時,這一點一定要記住

    end if

    conn.close '關閉連接,

    set conn=nothing '釋放內存 這兩句很重要,不然會占用大量服務器資源。

    %>

    <html>

    <head>

    <title>用戶注冊案例</title>

    <META content="中國ASP網編寫的用戶注冊案例教程。http://www.asp.org.cn" name=description>

    </head>

    <body>

    <form id="form1" name="form1" method="post" action="index.asp">

    <table width="400" border="1">

    <tr>

    <td>用戶名:</td>

    <td><label>

    <input name="username" type="text" id="username" size="16" maxlength="16" />

    </label></td>

    </tr>

    <tr>

    <td>密碼:</td>

    <td><input name="password" type="password" id="password" size="16" maxlength="16" /></td>

    </tr>

    <tr>

    <td>確認密碼:</td>

    <td><input name="password2" type="password" id="password2" size="16" maxlength="16" /></td>

    </tr>

    <tr>

    <td colspan="2"><label>

    <input type="submit" name="Submit" value="提交" />

    </label></td>

    </tr>

    </table>

    </form>

    </body>

    </html>

    更多信息請查看IT技術專欄

    更多信息請查看網絡編程
    易賢網手機網站地址:asp用戶注冊示例代碼

    2026上岸·考公考編培訓報班

    • 報班類型
    • 姓名
    • 手機號
    • 驗證碼
    關于我們 | 聯系我們 | 人才招聘 | 網站聲明 | 網站幫助 | 非正式的簡要咨詢 | 簡要咨詢須知 | 新媒體/短視頻平臺 | 手機站點 | 投訴建議
    工業(yè)和信息化部備案號:滇ICP備2023014141號-1 云南省教育廳備案號:云教ICP備0901021 滇公網安備53010202001879號 人力資源服務許可證:(云)人服證字(2023)第0102001523號
    聯系電話:0871-65099533/13759567129 獲取招聘考試信息及咨詢關注公眾號:hfpxwx
    咨詢QQ:1093837350(9:00—18:00)版權所有:易賢網