📄 login.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%response.Buffer=true%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%
strconn="DRIVER=Microsoft Access Driver (*.mdb);DBQ="& Server.MapPath("user.mdb")
set conn = server.createobject("adodb.connection")
conn.open strconn
%>
</head>
<body>
<center>
<%
set rstemp=server.CreateObject("adodb.recordset")
dim strname,strpassword,sql
strname=request.Form("username")
strpassword=request.Form("password")
sql="select*from user where username='"&strname&"'"
rstemp.open sql,conn,1,3
if strname=""then
response.Write "账号不能为空<p></p>"
%>
<a href=javascript:history.back()>上一页</a>
<%
response.End
end if
if strpassword=""then
response.Write "密码不能为空<p></p>"
%>
<a href=javascript:history.back()>上一页</a>
<%
response.End
end if
if rstemp.RecordCount=1 then
if rstemp("password")=strpassword then
session("uesrname")=strname
response.Redirect"user.html"
else
%>
<a href=javascript:history.back()>密码错误 请重新输入</a>
<%
end if
else
%>
<a href=javascript:history.back()>账号错误 请重新输入</a>
<%
response.End
end if
rstemp.close
set rstemp=nothing
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -