登陆页面被提交到logincheck.asp进行验证,其代码如下:
<!--#include file="conn.asp"-->
<%
uid=trim(Request("name_id"))
upwd=trim(Request("password"))
if uid="" or upwd="" then
response.write ("<script language=javascript>alert('用户名和密码不能为空!');history.go(-1);</script>")
'判断帐号及密码是否正确
else
set rs=server.Createobject("adodb.recordset")
str="select * from [admin]"
rs.open str,conn,1,3
if uid=rs("name_id") and upwd=rs("password") then
Session("admin")=uid
response.redirect "admin_Index.asp"
else
response.write ("<script language=javascript>alert('用户名和密码不匹配,请重新输入!');history.go(-1);</script>")
end if
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
%>