1. 程式人生 > >asp登錄校驗及登錄檢測

asp登錄校驗及登錄檢測

AD ODB conf sel records 登錄 oca object ESS

<%

dim name,pwd

name=trim(request("name"))

pwd=trim(request("pwd"))

if name=”” or pwd=”” then

response.Write "<script>alert(‘賬戶密碼不能為空!‘);location=‘manage/main.asp‘</script>"

else

set rs=server.createobject("adodb.recordset")

sql="select * from admin where name=‘"&name&"‘"

rs.open sql,conn,1,1

if not rs.eof then

if pwd=rs("pwd") then

session("mm_username")=""

session("mm_username")=rs("name")

session("qx")=rs("qx")

response.Write "<script>alert(‘登陸成功‘);location=‘manage/main.asp‘</script>"

else

Response.Write "<script language=‘javascript‘>window.confirm(‘帳號和密碼不正確,請返回重填!‘);parent.window.history.go(-1);</script>"

end if

else

Response.Write "<script language=‘javascript‘>window.confirm(‘用戶名不正確,請返回重填!‘);parent.window.history.go(-1);</script>"

end if

end if

%>

asp登錄校驗及登錄檢測