asp 登陆源码

来源:百度知道 编辑:UC知道 时间:2024/06/05 19:38:14
请各位高人给检查一下以下asp 登陆源码代码是否正确,如果出错,错在哪里,本人新手,请多指导!谢谢
<%
if request("action")="chk" then
uid=request("uid")
dyzz=request("dyzz")
if uid="" or dyzz="" then
Response.Write "<script language='javascript'>alert('请将信息填写完整');history.go(-1);</script>"
Response.End()
end if

if uid<>"" and dyzz<>"" then
set rs=server.createobject("Adodb.Recordset")
sql="select * from uid where uid='"&uid&"'and dyzz="&dyzz
rs.open sql,conn,1,2
if rs.eof then
Response.Write "<script language='javascript'>alert('没有查询到指定记录');history.go(-1);</script>"
Response.End()
else
id=rs("id")
uid=rs("uid")
dyzz=rs("dyzz")
rs.close
end if
%>

1,
if request("action")="chk" then
uid=request("uid")
dyzz=request("dyzz")
request没有方法或属性.是不是应该这样子:
if request.QueryString("action")="chk" then
uid=request.form("uid")
dyzz=request.form("dyzz")
2,
还有conn设置正确吗?没有看到你的包含文件,貌似<!--#include file="**/**/conn.asp">之类的.
3,
有时conn.asp测试正确,引用后却出错,很可能是conn中路径不正确.
呵呵,有点画蛇添足了,我收声,祝你好运!!

登陆界面:
<html>

<head>
<title>网站后台登录</title>
</head>

<body>
<%
xuasmdb="db1.mdb" '数据库地址

set conn=server.CreateObject("adodb.connection") '创建数据连接对象
DBPath = Server.MapPath(xuasmdb) '得到物理地址
conn.open "provider=microsoft.jet.oledb.4.0; data source="&DBpath '打开数据库

if request("user")="" or request("pass")=