navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
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

Search Forums
 

Advanced search
Recent Posts

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

Microsoft MVP

 

HTTP Referrer

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

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

All Forums >> Web Development >> ASP and Database >> HTTP Referrer
Page: [1]
 
BeTheBall

 

Posts: 6336
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
HTTP Referrer - 8/29/2003 16:37:37   
Can I use the http referrer to prevent users from accessing a certain page without clicking a link on another page? In other words, I have two pages, Page1 and Page2. I don't want anyone to access Page1 w/o going through Page2. I am guessing I can write code that will allow access if the referring page is Page1 and redirect if not, just not sure of the syntax.
bobby

 

Posts: 11394
Joined: 8/15/1969
From: Seattle WA USA
Status: offline

 
RE: HTTP Referrer - 8/29/2003 17:12:57   
Or...

Set up a link from the "required page" to the other, and pass a string value...

<a href="page2.asp?foo=yes">Click here</a>

... then at the top of page2.asp...

<%
response.buffer=true

if request.querystring("foo")<>"yes" then
response.redirect ("page1.asp")
else
end if
%>

Now, in order to visit page2.asp, you have to be coming from the link on page1.asp...

_____________________________

If con is the opposite of pro, is Congress the opposite of progress?


:)

(in reply to BeTheBall)
Spooky

 

Posts: 26597
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: HTTP Referrer - 8/29/2003 18:04:03   
http referer is not always guaranteed, but you vould use it - request.servervariables("http_referer")
Another option (again not always available if cookies are blocked) is to set a session when they have visited the page and check it on entry to the page 2

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to BeTheBall)
Doug G

 

Posts: 1189
Joined: 12/29/2001
From: SoCal
Status: offline

 
RE: HTTP Referrer - 8/29/2003 21:20:16   
If you do use it don't spell referrer properly. From way back when HTTP_REFERER has been misspelled :)

_____________________________

======
Doug G
======

(in reply to BeTheBall)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> HTTP Referrer
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