一個登陸視窗的記數判斷登入(有用哦),瞭解IF語句的用應

來源:互聯網
上載者:User
語句 <%
n=0
adminID=Request("adminID")
password=Request("password")

if adminID="" then %>
<script language=vbscript>
MsgBox "錯誤:請輸入管理使用者名!"
location.href = "javascript:history.back()"
</script>
<%elseif password="" then%>
<script language=vbscript>
MsgBox "錯誤:請輸入你的密碼!"
location.href = "javascript:history.back()"
</script>
<%end if%>

<!--#include file="connect.asp" -->
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
<%
'session.timeout=10'session對象的逾時值
'on error resume next
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("examination.mdb")

Set rs = Server.CreateObject("ADODB.Recordset")
%>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
<%rs.Open "Select * From 管理 where adminID='"&adminID&"'", conn, 3,3%>
<% if rs.bof or rs.eof then%>
<script language=vbscript>
MsgBox "錯誤:該使用者名稱不存在,請確認你是管理員!"
location.href = "javascript:history.back()"
</script>
<% elseif rs("password")<>password then%>

<% if rs("登陸次數")>3 then %>
<script language=vbscript>
MsgBox "錯誤:登入次數太多!系統將關閉!"
location.href="javascript:window.close()"
</script>
<% else %>
<script language=vbscript>
MsgBox "<% =rs("登陸次數")%>錯誤:該密碼不正確,請確認你是管理員!"
location.href = "javascript:history.back()"
</script>
<%
rs("登陸次數")=rs("登陸次數")+1
rs.update
end if
else
rs("登陸次數")=0
rs.update
session("logstatus")=1 '記錄登陸狀態
response.redirect "admin.asp"
end if
conn.close
set rs=nothing
%>




相關文章

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

11.11 Big Sale for Cloud

Get Unbeatable Offers with up to 90% Off,Oct.24-Nov.13 (UTC+8)

Get It Now >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。