Thank you Robert. This is an area I haven't previously used so if you'll
bare with me I think I'm beginning to understand it a bit better after
reading the relevant sections in Ben Forta's book.

The plan is to create a simple quiz comprising 7 pages, 5 for the quiz, one
to enter your details if you get to the end and one for the certificate.
Lets call them A, B, C, D, E, F and G. The test is not marked - you just
have to get to the last page E and answer the question right to qualify.

I think what I need to do is establish an application.cfm file to initialise
the variable rather than in the first page (correct me if I'm wrong please):

<cfapplication name="SmartMoveTest"
               sessionmanagement="Yes"
               setclientcookies="No"
               sessiontimeout="0,1,0,0"
               clientstorage="Registry">

<!--- Initialise active page variable --->
                           
<cfif NOT ISDEFINED("session.activePage")>
<cfset session.activePage = 1>

</cfif>

Then as you suggested check for the variable in page 2


<cfif NOT IsDefined("session.activePage")>
        <cflocation template="index.cfm">
</cfif> 

What I also need to check is that someone else hasn't hopped in on the
details page and entered there own details to create further certificates
without doing the test by pressing the back button from the certificate
page. I think I can also use this to check for using the back button so that
someone doesn't manipulate previous answers to get the right outcome without
reviewing the material. I think if I retain the variable acvtivePage but
change its value page to page I can do this. Again correct me if I'm wrong
but the code in page 2 might look like this:

<cfif NOT IsDefined("session.activePage")>
        <cflocation template="index.cfm">
<cfelseif session.activePage = 3>
        <cflocation template="index.cfm">
<cfelse>
        <cfset session.activePage = 2>
</cfif> 

Then in page 3 check that session.activePage has a value of 2, then in page
4 check that session.activePage has a value of 3 etc This way if someone
hits the back button on say page 4 session.activePage would have a value of
3 whereas it should be 2 so the user should be sent back to index.cfm (but
I'm not quite sure how to code this come to think of it - I think I've got
it right).


+++++++++++++++++++++
Kevin Parker
Web Services Manager
WorkCover Corporation

[EMAIL PROTECTED]

www.workcover.com

p: +61 8 82332548
f: +61 8 82332000
m: 0418 800 287

+++++++++++++++++++++


-----Original Message-----
From: Robert Long [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 6 March 2001 10:04:AM
To: CF-Talk
Subject: RE: One page calls another


you could set some kind of variable (ie session, cookie, url, etc) that
would only be 
set on page 1 and if it doesn't exist then <cflocation> them to page 1. Code
example below.

--Page 1---
<cfset session.VisitedPage1 = 'Yes'>


-- Page 2 ---
<cfif NOT IsDefined("session.VisitedPage1")>
        <cflocation template="page1.cfm">
</cfif>

Hth,
Robert



-----Original Message-----
From: Parker, Kevin [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 05, 2001 4:53 PM
To: CF-Talk
Subject: One page calls another



A little while ago I wrote to the list seeking some advice on how I could
ensure that a given page could not be loaded (lets call it B) unless the
user had come, by some means, from another specified page (lets call it A),
i.e. if the user went to direct to page B they would automatically be
directed back to page A.

Thank you to all of those that replied.

Because I'm not using forms in this app, using hidden fields, doesn't seem
workable. Someone suggested that I use HTTP Referrer but its unclear to me
how to use this, despite some research. Can anyone give me some
samples/examples on how to code this please.

TIA!!!!!


+++++++++++++++++++++
Kevin Parker
Web Services Manager
WorkCover Corporation

[EMAIL PROTECTED]

www.workcover.com

p: +61 8 82332548
f: +61 8 82332000
m: 0418 800 287

+++++++++++++++++++++



****************************************************************************
This e-mail is intended for the use of the addressee only. It may contain
information that is protected by legislated confidentiality and/or is
legally privileged. If you are not the intended recipient you are prohibited
from disseminating, distributing or copying this e-mail. Any opinion
expressed in this e-mail may not necessarily be that of the WorkCover
Corporation of South Australia. Although precautions have been taken, the
sender cannot warrant that this e-mail or any files transmitted with it are
free of viruses or any other defect.
If you have received this e-mail in error, please notify the sender
immediately by return e-mail and destroy the original e-mail and any copies.
****************************************************************************
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to