OutFront Forums
     Home    Register     Search      Help      Login    

Follow Us
On Facebook
On Twitter
RSS
Via Email

Recent Posts
Todays Posts
Most Active posts
Posts since last visit
My Recent Posts
Mark posts read

Sponsors
Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.
Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.
Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

 

Checking/Forcing Referrer Pages

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> General Web Development >> Checking/Forcing Referrer Pages
Page: [1]
 
DarlingBri

 

Posts: 3123
From: Left of Centre, Cork, Ireland
Status: offline

 
Checking/Forcing Referrer Pages - 6/7/2000 16:19:00   
Originally posted by Mike O at http://www.frontpagewebmaster.com/ubb/Forum1/HTML/001711.html

quote:

The Asp script is :

<%
Response.Buffer = True

'checks previous page is valid
sPg = Request.ServerVariables("HTTP_REFERER")
If (Instr(sPg,"URLofsendingpage") = 0) and _
(Instr(sPg, "URLofthispage") = 0) then
Response.Clear
Response.Redirect("URLoferrorpage")
End If
%>

Place this above the <HEAD> tag.

"URLofthispage" is required in case Refresh is clicked.

"URL..." can be the complete URL or any part of it. If developing the page using PWS then publishing to another server then the full URL of the pages may change. This has to be corrected in the script at the time of publishing.

If the page can be called by more than one page then add another "and _" line to the above script.

If the test fails then Response.Redirect("URLoferrorpage") sends the visitor to an error screen. Otherwise the current page is displayed.

Hope this helps.


This code can be used to check that a visitor has reached a page through a secure server, for example, or by completing a form, or for invalidating bookmarks, or any number of useful ways.

The original post also contains a link to a tutorial on building a cookie that will perform the same task. Cookies could be useful for controlling repeat visitors.

------------------
You! Off my planet!
-------------------
Work, work, work: http://www.appercept.co.uk
Out of Office Hours: http://www.darlingbri.co.uk

Page:   [1]

All Forums >> Web Development >> General Web Development >> Checking/Forcing Referrer Pages
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts