一个简单用户登陆界面

shbvkb 2003-05-20 06:36:03
第一个界面是:sub.html
<html>
<head>
<title>升势资讯网</title>
<body>
<form name="form1" method="post" action="sub.asp">
<p> 管理员:
<input type="text" name="UserID" size="25" maxlength="20">
密 码:
<input type="text" name="Pass" size="12" maxlength="20">
<input type="submit" name="Submit" value="提交">
</p>
</form>
</body>
</html>

第二个界面是:sub.asp
<%@ language=vbscript%>
<% option explicit %>
<html>
<head>
<title>
</title>
</head>
<body>
<%
dim user
dim pass
user=Request.From("UserID")
if user="" then
response.redirect "err1.htm"
response.end
end if
pass=request.from("Pass")
if pass="" then
response.redirect "err2.htm"
response.end
end if
file=server.mappath("access")
set conn=server.createobject("adodb.connection")
dr="driver={microsoft access driver (*.mdb)};dbq="&file
conn.open dr
set rs=server.createobject("adodb.recordset")
sql="select * from where name='"&user&"' and password='"&pass&"'"
rs.open sql
if not rs.eof then
reponse.redirect "login.asp"
else
response.write "err3.htm"
end if
%>
</body>
</html>
不知为什么不能实现
...全文
45 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
qjrein 2003-05-20
  • 打赏
  • 举报
回复
file=server.mappath("access")这是什么?如果是得到数据路绝对路径的话也应该是
file=server.mappath("access.mdb")

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧