当前位置: 代码迷 >> ASP >> 小疑点
  详细解决方案

小疑点

热度:154   发布时间:2012-03-13 11:21:12.0
小问题
<%
dim   sql
dim   rs  
dim   username
dim   password
username=replace(trim(request( "username ")), " ", " ")
password=replace(trim(request( "password ")), " ", " ")
set   rs=server.CreateObject( "adodb.recordset ")
sql   =   "select   *   from   admin   where   password= ' "&password& " '   and   username= ' "&username& " ' "
rs.open   sql,conn,1,1
if   not(rs.bof   and   rs.eof)   then
if   password=rs( "password ")     then
session( "username ")=rs( "username ")

response.Redirect "newsedit.asp "
else
  call   error
  end   if
else
  call   error()
  end   if
sub   error()
  response.Write "用户名或密码错误!! <br> <br> "
  response.Write " <a   href= 'javascript:onclick=history.go(-1) '> 返回 </a> "
end   sub
rs.close
conn.close
set   rs=nothing
set   conn=nothing
%>

输入用户名,密码提交后总是提示用户名密码错误,大家帮我看看哪里   错了

------解决方案--------------------
username=replace(trim(request( "username ")), " ", " ")
password=replace(trim(request( "password ")), " ", " ")
----------------------
在后面加上
response.write(username)
response.write(password)
  相关解决方案