不可以啊
我使过拉
比如我用1用户名进入fygl.asp 然后在浏览器上输入fybj.asp 就可以进去 1用户的qx字段为FALSE 不是true不应该能进去
<!-- #include file="connn.asp"-->
<!-- #include file="md5.asp"-->
<%
name=trim(request.Form("name"))
pwd=trim(request.Form("pwd"))
set rs=server.CreateObject("adodb.recordset")
sql="select * from pwd where name='"&name&"' and pwd='"&md5(pwd)&"'"
set rs=conn.execute(sql)
if rs.eof or rs.bof then
response.write "<script language=javascript>"
response.write "alert('用户或密码不对!');"
response.write "javascript:history.go(-1);"
response.write "</script>"
else
if rs("qx")=true then
session("name")=name
response.write"<SCRIPT language=JavaScript>alert('登陆成功');"
response.write"this.location.href='fygl.asp';</SCRIPT>"
else
session("name")=name
response.write"<SCRIPT language=JavaScript>alert('登陆成功');"
response.write"this.location.href='fytj.asp';</SCRIPT>"
end if
end if
%>
fygl.asp
<!-- #include file="connn.asp"-->
<%if session("name")<>"" and session("qx")=true then%>
<%
else
%>
<script language="javascript">alert('请登录');location.href='index.asp';</script>
<%
end if
%>