各位大侠,帮我看看这段代码嘛,我输入数据库里面providername和providerid的值,但是显示“用户代号或密码错误”肯定哪里出问题了,帮我看看吧,谢
各位大侠,帮我看看这段代码嘛,我输入数据库里面providername和providerid的值,但是显示“用户代号或密码错误”肯定哪里出问题了,帮我看看吧,谢谢了<!--#include file="const.asp" -->
<!--#include file="Connections/conn.asp" -->
<%
function ReplaceBadChar(strChar)
if strChar="" then
ReplaceBadChar=""
else
ReplaceBadChar=replace(replace(replace(replace(replace(replace(replace(strChar,"'",""),"*",""),"?",""),"(",""),")",""),"<",""),".","")
end if
end function
hid_havemit=request("hid_havemit")
if hid_havemit="yes" then
user_password=ReplaceBadChar(trim(request("user_password")))
user_name=ReplaceBadChar(trim(request("user_name")))
Set rs_tab_user = Server.CreateObject("ADODB.Recordset")
sql="select * from provider where providername ='" & user_name & "' and providerid = '" & user_password & "' and super=1"
rs_tab_user.open sql,conn,1,1
if rs_tab_user.eof and rs_tab_user.bof then
errstr="<p align=center>用户代号或密码错误!</p>"
response.write errstr
else
session("superuserpass")="yes"
session("userid")=rs_tab_user("providername")
response.redirect "super.asp"
end if
end if
%>
<html>
<head>
<style type="text/css">
<!--
body,td,input {
font-family: "宋体";
font-size: 9pt;
}
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>超级用户登录</title>
</head>
<body bgcolor="#eeeeee" topmargin="10" leftmargin="10" rightmargin="10" topmargin="0" marginwidth="0" marginheight="0">
<center>
<fieldset id="login" style="width:750;height:100%">
<legend><font color="#3399CC"><b>☆超级用户登录☆</b></font></legend>
<form method="POST" >
<input type="hidden" name="hid_havemit" value="no">
<table border="1" align="center" cellspacing="0" bordercolordark="#cccccc">
<tr>
<td colspan="4" bgcolor="#C4C4C4">
<p align="center"><strong>信息参考</strong> 管理入口</p>
</td>
</tr>
<tr>
<td bgcolor="#EEEEEE">管理员代号:
</td>
<td bgcolor="#EEEEEE"><input type="text" name="user_name" size="10">
</td>
<td bgcolor="#EEEEEE">管理员密码:
</td>
<td bgcolor="#EEEEEE"><input type="password" name="user_password" size="10">
</td>
</tr>
<tr>
<td bgcolor="#EEEEEE" colspan="4"> <p align="center">
<input name="B3" type="button" id="B3" value="更改密码" onclick="javascript:tmp=window.open('secret.asp','changepassword','top=0,left=0,width=260,height=150,scrollbars=no');tmp.focus();">
<input type="reset" value="全部重写" name="B2">
<input type="submit" onclick="hid_havemit.value='yes'" value="马上登录" name="B1">
</p>
</td>
</tr>
</table>
</form>
</fieldset>
</center>
</body>
</html>
各位大侠,帮我看看这段代码嘛,我输入数据库里面providername和providerid的值,但是显示“用户代号或密码错误”肯定哪里出问题了,帮我看看吧,谢谢了