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

    asp用戶(hù)登錄模塊實(shí)例代碼
    來(lái)源:易賢網(wǎng) 閱讀:523 次 日期:2014-10-27 12:53:10
    溫馨提示:易賢網(wǎng)小編為您整理了“asp用戶(hù)登錄模塊實(shí)例代碼”,方便廣大網(wǎng)友查閱!

    asp用戶(hù)登錄模塊實(shí)例代碼:

    用戶(hù)登錄驗(yàn)證腳本,chkpwd.asp

    以下為引用的內(nèi)容:

    <%

    '=======用戶(hù)登錄驗(yàn)證腳本=======

    '如果尚未定義passed對(duì)象,則將其定義為false,表示沒(méi)有通過(guò)驗(yàn)證

    if isempty(session(passed)) then

    session(passed)=false

    end if

    'session(passed)=false,表示尚未通過(guò)驗(yàn)證,則開(kāi)始讀取從表單傳來(lái)的驗(yàn)證信息

    if session(passed)=false then

    username=request.form(username)

    userpwd=request.form(userpwd)

    if username= then

    errmsg=提示:請(qǐng)輸入用戶(hù)名和密碼

    else

    '===================連接數(shù)據(jù)庫(kù)=====================

    set conn= server.createobject(adodb.connection)

    conn.connectionstring= driver={sql server};server=192.168.1.3;uid=sa;pwd=;database=zcmrs

    conn.open

    '===================從表log中讀取用戶(hù)數(shù)據(jù)=====================

    '定義recordset對(duì)象

    set rs=server.createobject(adodb.recordset)

    '設(shè)置connection對(duì)象的connectionstring

    set rs.activeconnection=conn

    '設(shè)置游標(biāo)類(lèi)型

    rs.cursortype=3

    '打開(kāi)記錄集

    rs.open select username,password from erpuser where username='&username&'

    '===================身份驗(yàn)證======================

    if rs.eof then

    errmsg=提示:用戶(hù)不存在或密碼錯(cuò)誤

    else

    if userpwd<>rs.fields(password) then

    errmsg=提示:登錄失敗!密碼錯(cuò)誤?

    else '登錄成功

    errmsg=

    session(passed)=true

    session(username)=rs.fields(username)

    '標(biāo)識(shí)用戶(hù)權(quán)限 session(userid)=rs.fields(userid)

    end if

    end if

    end if

    end if

    '經(jīng)過(guò)登錄不成功,則畫(huà)出登錄表單

    if not session(passed)=true then

    %>

    <html>

    <head><title>無(wú)標(biāo)題文檔</title>

    <style type=text/css>

    <!--

    .style1 {font-size: 12px;font-weight:bold;margin-left:120px;outline:double}

    -->

    </style>

    <style type=text/css>

    <!--

    .style2 {font-size: 12px;font-weight:bold;outline:double;color:#ff3333}

    -->

    </style>

    </head>

    <body leftmargin=0 topmargin=0 marginheight=0 marginwidth=0 bgcolor=#000000>

    <div id=parent style=height:300;width:450;border-style:solid;border-color:#ffffff;margin-top:80px;margin-left:25%;margin-right:25%;background-color:#ffffff>

    <div id=denglu style=font-size:12px;font-weight:bold;background-color:#0099ff;text-align:center;height:40px;><br>erp系統(tǒng)登錄</div>

    <form action=<%=request.servervariables(path_info)%> method=post name=myform id=myform>

    <p class=style1>用戶(hù)名:<input name=username type=text id=username size=18 maxlength=20>

    </p>

    <p class=style1>密 碼:<input name=userpwd type=password id=userpwd size=18 maxlength=20>

    </p>

    <p align=center class=style2><%=errmsg%> </p>

    <p> 

    <input type=submit align=middle name=submit value=登錄系統(tǒng)> 

    <input name=rege type=button align=middle onclick=location='register.asp' id=rege value=注冊(cè)用戶(hù)>

    </p>

    </form>

    </div>

    </body>

    </html>

    <%

    '<p class=style1>驗(yàn)證碼:<input name=checkcode type=text id=checkcode size=6 maxlength=4>

    '<img style=margin-right: 40px alt= src=common/getcode.asp></p>

    response.end

    end if

    %>

    要訪問(wèn)的頁(yè)面erp.asp

    <以下為引用的內(nèi)容:

    <!--#include file=chkpwd.asp-->

    <body>

    <div style='font-size:12px;font-weight:bold;border:1px solid #001;padding:4px;background:#ffccff;margin-top:0;'>歡迎使用erp查詢(xún)系統(tǒng),當(dāng)前登錄用戶(hù)為:

    <%

    if session(passed)=true then

    response.write(session(username))

    end if

    %><a href=logout.asp>退出系統(tǒng)</a>

    </div>

    </body>

    以上每次打開(kāi)erp.asp的時(shí)候,都首先執(zhí)行chkpwd.asp(),這樣可以有效防止未授權(quán)用戶(hù)訪問(wèn)指定網(wǎng)頁(yè).

    logout.asp系統(tǒng)退出

    <body>

    <%

    session(passed)=false

    session(username)=

    response.redirect(index.asp)

    %>

    </body>

    使用圖片提交表單

    以下為引用的內(nèi)容:

    <form name=form1 method=post action=>

    <td align=right><input type=image method=submit name=submit src=image/loginin.gif width=70 height=21 alt=submit></td>

    </form>

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

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

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

    • 報(bào)班類(lèi)型
    • 姓名
    • 手機(jī)號(hào)
    • 驗(yàn)證碼
    關(guān)于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡(jiǎn)要咨詢(xún) | 簡(jiǎn)要咨詢(xú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)警備案專(zhuān)用圖標(biāo)
    聯(lián)系電話:0871-65099533/13759567129 獲取招聘考試信息及咨詢(xún)關(guān)注公眾號(hào):hfpxwx
    咨詢(xún)QQ:1093837350(9:00—18:00)版權(quán)所有:易賢網(wǎng)
    云南網(wǎng)警報(bào)警專(zhuān)用圖標(biāo)