按理说那段程序是可以的,但既然不行可以换个思路啊!
你可以先查询用户是否存在,有的话再用if判断输入的密码是否正确啊,象下面的你试试:
<!--#include file="conn.asp" -->
<%set rs=server.createobject("adodb.recordset") %>
<%
name=request("name1")
pwd1=request("pwd0")
pwd1=request("pwd1")
set cn=server.createobject("adodb.connection")
set rs=server.createobject("adodb.recordset")
sql="select * from admin where admin_name='"&name&"'"
rs.Open sql,conn,1,1
if 用户名存在 then
dim userpsd
userpsd=rs("admin_psd")
if 密码相符 then
修改密码
response.write "<script language=JavaScript>" & chr(13) & "alert('OK! 信息修改成功!');"&"window.location.href = 'admin.asp'"&" </script>"
else
response.write "<script language=JavaScript>" & chr(13) & "alert('对不起!不能修改!');" & "history.back()" & "</script>"
end if
else
response.write "<script language=JavaScript>" & chr(13) & "alert('对不起!不能修改!');" & "history.back()" & "</script>"
end if
rs.Close
set rs=nothing
conn.close
set conn=nothing
%>
好象有点麻烦,但你可以参考!呵呵~~~~~~~~~~