<label id="2a06w"><tt id="2a06w"></tt></label><label id="2a06w"><tt id="2a06w"><em id="2a06w"></em></tt></label><menu id="2a06w"></menu>
  • <dfn id="2a06w"><var id="2a06w"><label id="2a06w"></label></var></dfn>
    <sup id="2a06w"><button id="2a06w"><em id="2a06w"></em></button></sup>
    <dfn id="2a06w"><var id="2a06w"></var></dfn>
    <dfn id="2a06w"></dfn>
  • <dfn id="2a06w"><code id="2a06w"><ins id="2a06w"></ins></code></dfn>
  • <small id="2a06w"><samp id="2a06w"></samp></small>
  • <dfn id="2a06w"><table id="2a06w"><center id="2a06w"></center></table></dfn>
    <label id="2a06w"><tt id="2a06w"><em id="2a06w"></em></tt></label>
    <strike id="2a06w"><form id="2a06w"></form></strike>
    <menu id="2a06w"><tt id="2a06w"></tt></menu>

    將想法與焦點(diǎn)和您一起共享

    ASP用戶(hù)登錄模塊的設(shè)計(jì)發(fā)布者:本站     時(shí)間:2020-05-06 16:05:49

    以下為引用的內(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>






    選擇我們,優(yōu)質(zhì)服務(wù),不容錯(cuò)過(guò)
    1. 優(yōu)秀的網(wǎng)絡(luò)資源,強(qiáng)大的網(wǎng)站優(yōu)化技術(shù),穩(wěn)定的網(wǎng)站和速度保證
    2. 15年上海網(wǎng)站建設(shè)經(jīng)驗(yàn),優(yōu)秀的技術(shù)和設(shè)計(jì)水平,更放心
    3. 全程省心服務(wù),不必?fù)?dān)心自己不懂網(wǎng)絡(luò),更省心。
    ------------------------------------------------------------
    24小時(shí)聯(lián)系電話(huà):021-58370032
    99人妻中文字幕视频在,亚洲无码视频在线免费看,久久国产乱子伦免费精品,日本中文字幕色视频网站
    <label id="2a06w"><tt id="2a06w"></tt></label><label id="2a06w"><tt id="2a06w"><em id="2a06w"></em></tt></label><menu id="2a06w"></menu>
  • <dfn id="2a06w"><var id="2a06w"><label id="2a06w"></label></var></dfn>
    <sup id="2a06w"><button id="2a06w"><em id="2a06w"></em></button></sup>
    <dfn id="2a06w"><var id="2a06w"></var></dfn>
    <dfn id="2a06w"></dfn>
  • <dfn id="2a06w"><code id="2a06w"><ins id="2a06w"></ins></code></dfn>
  • <small id="2a06w"><samp id="2a06w"></samp></small>
  • <dfn id="2a06w"><table id="2a06w"><center id="2a06w"></center></table></dfn>
    <label id="2a06w"><tt id="2a06w"><em id="2a06w"></em></tt></label>
    <strike id="2a06w"><form id="2a06w"></form></strike>
    <menu id="2a06w"><tt id="2a06w"></tt></menu>