我做了个asp密码验证,代码如下,看看哪里错了
<%
function checkPwd(ID,PSD)
dim conn,param,rs
set conn=server.createobject("ADODB.connection")
param="driver={Microsoft Access Driver (*.mdb)}"
conn.open param & ";dbq=" & server.mappath("users.mdb")
sql="select*from users where id='" & ID & "' and psd='" & PSD & "'"
set rs=conn.execute(sql)
if rs.eof then
checkpwd=false
else
checkpwd=true
end if
end function
%>
<%
if isEmpty(session("passed")) then session("passed")=false
id=request("ID")
psd=request("PSD")
if ID="" or PSD="" then
response.write"情输入用户名和密码"
elseif not checkpwd(ID,PSD) then
response.write"用户名或密码错误
请检查你的用户名和密码然后再试一次!"
else session=("passed")=true
end if
if not session("passed") then
%>
请输入你的用户名和密码!
登陆
">
<%response.end
end if %>