📄 checkuser.asp
字号:
<link href="style.css" rel="stylesheet" type="text/css">
<%
dim founderror,errormsg,susername,suserpwd,objrs,StrSQl
'是否产生错误,默认false
founderror=false
susername=session("studentname")
suserpwd=session("studentpassword")
'用户Session不存在,则产生登录错误
if susername="" or suserpwd="" then
Errormsg=Errormsg+"<br>"+"<li>对不起,您还没有登录或以超时!"
founderror=true
else
'用户名在数据库中不存在错误
Set objrs = Server.CreateObject("ADODB.Recordset")
StrSQL = "Select * from student where studentname='"&susername&"'"
objrs.open StrSQL,conn,1,1
if objrs.EOF then
Errormsg=Errormsg+"<br>"+"<li>用户名不存在!"
founderror=true
elseif suserpwd<>objrs("studentpassword") then
Errormsg=Errormsg+"<br>"+"<li>密码错误!"
founderror=true
end if
objrs.close
set objrs=nothing
end if
'显示错误信息,并停止页面的执行
if founderror=true then
call disperrs()
response.end
end if
'定义过程显示错误信息
sub disperrs()
%>
<table cellpadding=0 cellspacing=0 border=0 width=90% bgcolor="#0099cc" align=center>
<tr>
<td> <table cellpadding=5 cellspacing=1 border=0 width=100%>
<tr align="center">
<td width="100%" bgcolor="#99ccff"><font color="#000000"><b>错误信息</b></font></td>
</tr>
<tr>
<td width="100%"><font color="#000000"> <b>产生错误的原因可能是:</b><br>
<br>
<%=errormsg%><br>
<br>
</font> </td>
</tr>
<tr align="center">
<td width="100%" bgcolor="#99ccff"> <a href="javascript:history.go(-1)"><font color="#000000">
<< 返回上一页</font></a> </td>
</tr>
</table></td>
</tr>
</table>
<%
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -