📄 index.asp
字号:
<%@ Language=VBScript %>
<%
'response.write "OK!"
name=trim(request("name"))
passwd=trim(request("passwd"))
if name<>"" and passwd<>"" then
response.write "OK!"
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & Server.MapPath("数据库.mdb")
set rs= server.createobject("adodb.recordset")
'判断是否为用户
sql= "select * from 用户记录 where 用户名='"& name &"' and 密码='"& passwd &"'"
Set rs= conn.Execute(sql)
if not rs.eof then
session("pass")=1
session("user")=name
session("mima")=passwd
conn.close
response.redirect "yemian.htm"
else
Response.Write "非法用户!"
end if
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<form name="form1" method="get" action="index.asp">
<p><font color="#0000FF"><strong>请输入用户名</strong></font>:
<input name="name" type="text" id="name" size="15">
</p>
<p><font color="#0000FF"><strong>请输入密码</strong></font>:
<input name="passwd" type="password" id="passwd" size="15">
</p>
<p>
<input type="submit" name="Submit" value="登录">
<input type="reset" name="Submit2" value="取消">
</p>
<p><a href="register.asp"><font color="#996666" face="楷体_GB2312"><strong>注册为新用户</strong></font></a></p>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -