logincheck.asp
来自「简单的客户信息数据查询」· ASP 代码 · 共 41 行
ASP
41 行
<!--#include file="conn.asp"-->
<%
strusn=Trim(Request.QueryString("usn"))
strpwd=Trim(Request.QueryString("pwd"))
isadmin=Trim(Request.QueryString("isadmin"))
if strusn<>"" and strpwd<>"" then
' Response.Write isadmin
if isadmin<>"" and isadmin="DBMS" then
strSQL="Select * from AdminLogin Where usn='" & Trim(strusn) & "' and pwd='" & Trim(strpwd) & "'"
set rs=Server.CreateObject("ADODB.RECORDSET")
rs.Open strSQL,con,1,3
Response.Write strSQL
if rs.RecordCount>0 then
Session("usn")=strusn
Session("pwd")=strpwd
Session("isAdmin")="T"
response.Redirect "main.asp"
else
Response.Redirect "error.asp?info=不存在该用户信息"
end if
else
if isadmin="" or isadmin<>"DBMS" then
strSQL="Select * from UserLogin Where usn='" & Trim(strusn) & "' and pwd='" & Trim(strpwd) & "'"
set rs=Server.CreateObject("ADODB.RECORDSET")
rs.Open strSQL,con,1,3
Response.Write strSQL
if rs.RecordCount>0 then
Session("usn")=strusn
Session("pwd")=strpwd
Session("isAdmin")="F"
response.Redirect "main.asp"
else
Response.Redirect "error.asp?info=不存在该用户信息"
end if
end if
end if
'Response.Write strSQL
else
Response.Redirect "error.asp?info=没有填写用户名或密码!"
end if
%>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?