男子100m世界纪录:关于asp用户登录代码

来源:百度文库 编辑:高校问答 时间:2024/04/28 02:18:22
界面做好了denglu.asp如果验证成功进入index.asp 可是验证界面总是不好用帮我看看我错在哪里了?connection.asp文件里的代码是:
<%
set conn=server.createobject("adobd.connection")
conn.open "provider=microsoft.jet.oledb.4.0;data source="&server.MapPath("student.mdb")
%>
yanzheng.asp里的代码是:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<!__#include file="connection.asp"__>
</head>
<body>

<%
dim zhanghao,mima
zhanghao=request.form("zhanghao")
mima=request.form("mima")
if zhanghao="" then
%>
<script language=vbscript>
msgbox("帐号为空")
location.href="denglu.asp"
</script>
<% end if %>
<% if mima="" then
%>
<script language=vbscript> msgbox("密码为空")
location.href="denglu.asp"
</script>
<% end if %>
<%set rs=server.createobject("adodb.recordset")
rs.open "select * from student where zhanghao="&zhanghao,conn,1,1
if not rs.eof then
if mima=rs("mima") then
session("zhanghao")=zhanghao
location.href("index.asp")
end if
if rs.eof then
response.write ("用户帐号或者密码错误");location.href("denglu.asp")
end if
set rs=nothing
rs.close
%>
</body>
</html>
麻烦大家帮我看看 谢谢了 我很急用我的qq是149413460 在线等答案

仔细一看还真晕,set conn=server.createobject("adobd.connection") ,能是adobd????
完整的代码如下:
1.connection.asp里的代码是:
<%
set conn=server.createobject("adodb.connection")
conn.open "provider=microsoft.jet.oledb.4.0;data source="&server.MapPath("student.mdb")
%>

2.yanzheng.asp里的代码是:

<!--#include file="connection.asp"-->

<%
dim zhanghao,mima
zhanghao=request("zhanghao")
mima=request("mima")
if zhanghao="" then
%>
<script language=javascript>
alert("帐号为空");
location.href="denglu.asp"
</script>
<% end if %>
<% if mima="" then
%>
<script language=javascript>
alert("密码为空");
location.href="denglu.asp"
</script>
<% end if %>
<%set rs=server.createobject("adodb.recordset")
rs.open "select * from student where zhanghao='"&zhanghao&"'",conn,1,3
if not rs.eof then
if mima=rs("mima") then
session("zhanghao")=zhanghao
Response.write("<script>location.href('index.asp')</script>" )
else
response.write ("<script>alert('用户密码错误');location.href('denglu.asp')</script>")
end if
end if
if rs.eof then
response.write ("<script>alert('用户帐号错误');location.href('denglu.asp')</script>")
end if
set rs=nothing
rs.close

%>
改了两次了,加分加分!!!

<%set rs=server.createobject("adodb.recordset")
rs.open "select * from student where zhanghao='"&zhanghao & "' and mima='" & mima & "'",conn,1,1
if rs.eof then
response.write "<script language='javascript'>alert('用户帐号或者密码错误');document.location.href=("denglu.asp");</script>"
end if
set rs=nothing
rs.close
%>

asp在服务器上运行时不应该使用msgbox
<%dim zhanghao,mima
zhanghao=request("zhanghao")
mima=request("mima")
if len(zhanghao)<1 then
response.write"<script>alert('帐号不能为空!');history.back();</script>"
elseif len(mima)<1 then
response.write"<script>alert('密码为空!');window.navigate('addarticle.asp');</script>"
end if
%>

mipilover
你真猛,adobd这也看得出来,出什么问题嘛 ,狂晕
那小子也太没水平了