There are probably a few ways you can do this.
1) You can check cgi.http_referer(check my spelling on that). It returns the
URL of the page where you came from.
2) Don't have a page2.cfm! Have page1.cfm link to itself, and if the proper
URL variable is returned, you can CFINCLUDE the contents of page2. Of
course, someone could bookmark the new url, ie, page1.cfm?load2=1. You could
use a form on page 1, and if IsDefined("Form.LoadPage2") is defined, then
load page 2. That would stop people from bookmarking page2 (at least as far
as I know), but it wouldn't prevent someone from putting the form on a
different page and doing ACTION="yourserver/page1.cfm". Ditto for the URL
solution.
3) Maybe set asession var on page1, and if it doesn't exist on page2, push
them back? Of course, people could still link to page2, but their link would
only work if the user had actually gone to page1 sometime in the last X
minutes, where X is your sessiontimeout.
I'm just rambling now.
=======================================================================
Raymond Camden, Principal Spectra Compliance Engineer for Macromedia
Email : [EMAIL PROTECTED]
ICQ UIN : 3679482
"My ally is the Force, and a powerful ally it is." - Yoda
> -----Original Message-----
> From: Jerre Hale [mailto:[EMAIL PROTECTED]]
> Sent: Friday, May 18, 2001 11:59 AM
> To: CF-Talk
> Subject: Best way to limit access to a specific template from "only"
> previous template?
>
>
> What is the best way to limit access to a specific template? Template2
> can only be accessed via template1. Disallowing user access to
> template2 simply by typing in the specific url for template2. I see
> where
> <CFABORT> can limit access to a ip addresses as exampled in the manual
> Advanced Application Development, page 520;
>
> <CFIF Left(CGI.RMOTE_ADDR, 11) NEQ "208.193.16.">
> <H1>Unauthorized host detected! Access denied!</H1>
> <CFABORT SHOWERROR="You are not authorized to use this function!">
> </CFIF>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists