1" or stip<"96" or stip>"97") then
username=request.form("t1")
password=request.form("t2")
Set fs = CreateObject("Scripting.FileSystemObject")
Set thisfile = fs.OpenTextFile("dsn.txt")
db_loc=thisfile.readline
thisfile.close
cnstr=db_loc&&"uid="&&username&&";"&&"pid="&&password
on error resume next
set cn=server.createobject("adodb.connection")
cn.open cnstr
if err=3709 then %>
<p><font color="#FF0000">对不起,用户:<%=username%>没有访问权限,或密码不正确! <BR></font></p>
<form method="POST">
<p align="center">用户名:<input type="text" name="T1" size="20">口令:<input type="password" name="T2" size="20"><input type="submit" value="提交" name="B1"><input type="reset" value="全部重写" name="B2">
</p>
</form>
<%end if
cn.close
set cn=nothing%>
<%else %>
恭喜您,您已经通过了验证,可以直接使用本站点的资源!
<%end if%>
</body>
</html>
稍微修改一下上面如IP地址等信息,该程序就可以运行了。
当然,上面只是实现在一个页面中的防火墙功能。如果一个网站有多个页面的话,可以设置一个session变
上一页 [1] [2] [3] [4] 下一页