请教ASP源码问题

来源:百度知道 编辑:UC知道 时间:2024/06/04 08:22:37
谁帮我看下这段登陆代码是那里出错了,谢谢!
<!--#include file="conn.asp"-->
<!--#include file="error.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title><%="登陆"%></title>
<link href="css.css" rel="stylesheet" type="text/css" />
</head>
<%
dim founderr,errmsg
founderr=false
errmsg=""
dim logname
dim logpwd
if request("action")="login" then
logname=trim(replace(request("logname"),"'",""))
logpwd=trim(replace(request("logpwd"),"'",""))

if logname="" and logpwd="" then
founderr=true
errmsg=errmsg+"<br>"+"<li>请输入用户名或密码!"
end if
if founderr then
call dis

本来很容易的代码让你给写成什么样子了,太乱了,而且调用了很多其它页面的程序,你也没说程序是哪地方错误,错误提示是什么...
为什么非要写到一个页面去。那么多判断语句,你不觉得头晕?
我估计是提交时出的错,我用我的想法给你写,供参考:
dim founderr,errmsg
founderr=false
errmsg=""
dim logname
dim logpwd

if request("action")="login" then
logname=trim(replace(request("logname"),"'",""))
logpwd=trim(replace(request("logpwd"),"'",""))

if logname="" and logpwd="" then
founderr=true
errmsg=errmsg+"<br>"+"<li>请输入用户名或密码!"
end if
rs.open "select * from Customer where Cname='"&logname&"' and CPassword='"&logpwd&"'",conn,1,1
if rs.eof and rs.bof then
founderr=true
errmsg=errmsg+"<br>"+"<li>您输入的用户名和密码不正确!"
else
session("login")=sessionvar
session(