怎样把password和rs("password")都和错误信息一起显示出来

来源:百度知道 编辑:UC知道 时间:2024/06/29 00:13:31
代码
dim FoundErr
dim ErrMsg
dim sql,rs
dim username,password
username=replace(trim(request("username")),"'","")
password=replace(trim(Request("password")),"'","")
if UserName="" then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>用户名不能为空!</li>"
end if
if Password="" then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>密码不能为空!</li>"
end if
if FoundErr<>True then
password=md5(password)
set rs=server.createobject("adodb.recordset")
sql="select password from admin where username='"&username&"'"
rs.open sql,conn,1,3
if not(rs.bof and rs.eof) then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>用户名或密码错误1!!!</li>"
else
if password<>rs("password") then

if password<>rs("password") then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>用户名或密码错误!!!</li>"
else

修改为

if password<>rs("password") then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>密码错误(数据库中密码是:"&rs("password")&",你输入的是:"&password&")!!!</li>"
else