登录页面出错
(1)这是登录页面denglu.asp主要相关代码:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn/conn.asp"-->
<!--#include file="conn/jvfunction.asp"-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>登录页面</title>
<link href="css/css6.css" rel="stylesheet" type="text/css">
</head>
<body>
<form name="form1" method="post" action="dengluasp.asp" onSubmit="submitcheck()">
<table width="244" border="1" align="center">
<tr>
<td colspan="2">请您登录</td>
</tr>
<tr>
<td width="74"><div align="center">用户名</div></td>
<td width="154"><input name="name" type="text" size="20"></td>
</tr>
<tr>
<td><div align="center">密码</div></td>
<td><input name="pass" type="text" size="20"></td>
</tr>
(2)这是登录页面处理代码dengluasp.asp
<!--#include file="conn/conn.asp"-->
<%
dim rse,sqluser
set rse =server.CreateObject("adodb.recordset")
sqluser="select * from userinfo"
rse.open sqluser,conn,1,3
if rse("username")<>request("name") then
response.Write("用户名错误!")
else
if rse("password")<>request("pass") then
response.Write("密码错误!")
else
response.Write("登录成功!")
end if
end if
set rse=nothing
conn.close
set conn=nothing
%>
(3)当登录的时候总是显示“用户名错误!”
这是我的分析:应该是这句错误rse("username")<>request("name")
但是数据库中userinfo表的username字段与姓名输入文本框NAME属性名称name不一致,
但是,仔细检查后是一致的。
请指教,谢谢!