午夜国产狂喷潮在线观看|国产AⅤ精品一区二区久久|中文字幕AV中文字幕|国产看片高清在线

    asp用戶注冊(cè)示例代碼
    來(lái)源:易賢網(wǎng) 閱讀:704 次 日期:2014-10-27 14:29:53
    溫馨提示:易賢網(wǎng)小編為您整理了“asp用戶注冊(cè)示例代碼”,方便廣大網(wǎng)友查閱!

    asp用戶注冊(cè)示例代碼:

    數(shù)據(jù)庫(kù)設(shè)計(jì):

    表名:userinfo

    字段名 類型/長(zhǎng)度 說(shuō)明

    id 自動(dòng)編號(hào) 用戶id

    username text/16 用戶名

    password text/32 md5 32位加密

    addtime 時(shí)間日期 注冊(cè)時(shí)間

    代碼如下:

    <%

    'asp教程用戶注冊(cè)示例

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

    dim db,conn,myconn

    db=asporgcn.mdb '數(shù)據(jù)庫(kù)文件相對(duì)路徑

    set conn = server.createobject(adodb.connection) '創(chuàng)建對(duì)象實(shí)例

    myconn=provider=microsoft.jet.oledb.4.0;data source= & server.mappath(&db&)

    conn.open myconn

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

    username=request(username)

    password=request(password)

    password2=request(password2)

    if password<>password2 then

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

    response.end() '結(jié)束運(yùn)行

    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 '判斷用戶名是否已經(jīng)注冊(cè)

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

    response.end() '結(jié)束運(yùn)行

    else

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

    conn.execute(insert into userinfo([username],[password]) values('&username&','&password&')) '添加到數(shù)據(jù)庫(kù)注冊(cè)完成,password是access中的保留關(guān)鍵字。保留關(guān)鍵字用[]括起來(lái)就不會(huì)出錯(cuò)。

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

    end if

    rs.close

    set rs=nothing '使用完rs后一定要記得關(guān)閉與釋放,否則占用服務(wù)器資源,在asp程序面試時(shí),這一點(diǎn)一定要記住

    end if

    conn.close '關(guān)閉連接,

    set conn=nothing '釋放內(nèi)存 這兩句很重要,不然會(huì)占用大量服務(wù)器資源。

    %>

    <html>

    <head>

    <title>用戶注冊(cè)案例</title>

    <meta content=中國(guó)asp網(wǎng)編寫(xiě)的用戶注冊(cè)案例教程。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>確認(rèn)密碼:</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>

    更多信息請(qǐng)查看IT技術(shù)專欄

    更多信息請(qǐng)查看網(wǎng)絡(luò)編程
    易賢網(wǎng)手機(jī)網(wǎng)站地址:asp用戶注冊(cè)示例代碼
    由于各方面情況的不斷調(diào)整與變化,易賢網(wǎng)提供的所有考試信息和咨詢回復(fù)僅供參考,敬請(qǐng)考生以權(quán)威部門(mén)公布的正式信息和咨詢?yōu)闇?zhǔn)!

    2025國(guó)考·省考課程試聽(tīng)報(bào)名

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