否认声明/引用页检查

来源:互联网 发布:linux 入门基础教程 编辑:程序博客网 时间:2024/04/29 23:28
有种例子是你想查证用户点击链接获取某一个内容或者被浏览到否认声明,通过用户点击可以同意。这个例子会检查看是什么引用页,引用页不是跟当前页面位置相同而是一个显示的默认的浏览视图。提供给用户点击页面链接,然后内容显示的功能。
<html>
<body bgcolor="#FFFFFF">
<title>www.ttasp.net(Disclaimer/Referring Page Check)</title>
<%
script_name = request.servervariables("script_name")


'变量脚本名称会包括被请求的页面相对路径
the_link= "http://" & request.servervariables("HTTP_HOST") & script_name


'变量链接会包括http:// 和剩下的在第一个/之前的URL
the_referer= request.servervariables("http_referer")


‘变量引荐会跟踪最后的页面
‘用户是在点击链接之前让他们进入当前页面
‘如果进入了地址栏
‘点击来自邮件或者点击收藏夹引荐值为空
if (the_link <> the_referer) or (the_referer = "") then


‘检查看看引用页面是否也是当前页面
‘如果不显示否认声明和到当前页面的链接
%>
Disclaimer
<br>
You must read and agree to this prior to continuing on to the content
<br>
Click <a href="<%= script_name %>">here</a> to view content
<br>
Click <a href="javascript:history.go(-1)">here</a> to go back
<% else
‘如果用户点击了页面的链接回到这个页面然后
‘内容会是显示%>
Content
<br>
This will only display after the user has clicked a link<br>
making the referring and current page the same.
<% end if
'最后检查引用页面%>
</body>
</html>
0 0
原创粉丝点击