CodeAve.com CodeAve.com - ASP - Server Variables
ASP
·Read/Write
·Script Writers
·Database Display
·Response Objects
·Server Variables
·Random Events
·Articles
·Miscellaneous
·Contents
·What's New?
JavaScript
CSS
HTML
Maps
Links
Mail List
Search
Sitemap


 


Disclaimer/Referring Page Check
There are instances where you will want to verify that a user has clicked a link to get to certain content or that a disclaimer was viewed and "agreed to" by the user click. This example will check to see what the referring page to it was and it the referring page is not the same as the current page location than a default view will be displayed. Providing the user clicks on a link from that page then the content will be displayed.
View the Output
Text View
Print View
Mail this Link
Download the Code

<html>
<body bgcolor="#FFFFFF">
<title>CodeAve.com(Disclaimer/Referring Page Check)</title>
<%
script_name = request.servervariables("script_name")
' variable script_name will contain the relative path of the page being requested
the_link= "http://" & request.servervariables("HTTP_HOST") & script_name
' variable the_link will contain http:// plus the rest of the URL prior to the first /
the_referer= request.servervariables("http_referer")
' variable the_referer tracks the last page the user was on prior to clicking the link
' that led them to the current page. If it was type into the address bar,
' clicked on from email or clicked on as a favorite the referer value will ne null
if (the_link <> the_referer) or (the_referer = "") then
'Check to see if the referring page is also the current page
' if not show the disclaimer and a link to the current page
%>
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
' if the user has click a link on this page back to this page then the
' content will then display %>
Content
<br>
This will only display after the user has clicked a link<br>
making the referring and current page the same.
<% end if
' end check of referring page %>
</body>
</html>

 

 

 



ASP: What's New? | Articles | Script Writers | Database Display | Read/Write
Server Variables | Response Objects | Random Events | Miscellaneous
HTML: Forms | Hyperlinks | Headers | Tables | Hyperlinks | Headers | Text Display
JavaScript: Document Info | Forms | Images | Navigation | Script Writers
CSS: Basics | Page Display | Text Display | Script Writers | Miscellaneous
  • 2014 michael kors
  • air max women 2013
  • 2014 michael kors
  • air max 2014
  • oakley glasses
  • oakley glasses

  • Maps: Map Script Writers | Bing Maps | Google Maps
  • bottes fr
  • ugg boot
  • Privacy Statement

    CodeAve.com is hosted by MyHosting.com
    Donate Food Online with a Mouse Click at TheHungerSite.com
    Donate Land Online with a Mouse Click at TheRainForestSite.com
    © 1999 - 2017 CodeAve.com
    All Rights Reserved

  • Kids jordan 6 rings
  • Jordan retro 10
  • Jordan retro 3