📄 login.asp
字号:
<!--#include file="conn.asp" -->
<html>
<head>
<link rel="stylesheet" href="common.css" type="text/css">
<title>同学通讯录</title>
</head>
<body>
<%
'取得用户名和密码,并删除用户名和密码中的首尾空格
username=Trim(Request.Form("Username"))
userpass=Trim(Request.Form("PassWord"))
Commandtext="Select * From t_user where d_user='"&username&"'"
set rs=conn.Execute(commandtext,recordsAffected,adcmdtext)
'检查用户名和密码是否正确
if rs.eof then
Response.write"<p>对不起,指定的用户不存在!</p>"
Response.write"<a href='default.asp'>返回主页</a>"
Response.end
end if
if userpass=rs("d_pass") then
Session("level")=rs("d_level")
Response.Redirect"top.asp"
else
response.write"<p>对不起,密码错误!<p>"
response.write"<a href='default.asp'>返回首页</a>"
end if
Set conn=nothing
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -