• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 144
  • Last Modified:

How to ensure page sequence?

I am using ASP, MS IIS4, MS SQL 7.
I am writing some asps.  I want to force the
user to view the web page in defined sequence.
For example, one must read page1 , page2 and then page3.
He/she cannot directly go to page2 without having
visited page2, even he/she know the URL of page2.

Can you share your experience with me if you are
using different approach (even it is not a MS's approach) ?

Thank you very much?
1 Solution
There are several methods but I'll explain the simplest (and possibly most effective two).

Within IIS/ASP when the user hits your site store 1 in a session variable. When they hit page 2 check that the session variable contains 1 and change it to 2 if it does. Otherwise redirect him to the correct page. Then repeat this for each other page in the sequence.

The second method is similar except that in each page you check the HTTP_REFERER variable (request.servervariables("HTTP_REFERER") in asp). This variable holds the URL of page from which the current request was issued. Thus when page 2 is requested the variable should hold the URL of Page 1 and so on.

The advantage of the first system is that it can't be frigged but as a session_id cookie is sent by the server it does mean that cookies on the browser must be issued.

The advantage of the second method is that although it can be frigged by someone using TELNET it doesn't require cookies.

If you want to go one step further with the first method you could infact have just one accessible page that displays the next page on each hit, using the session variable to determine the page to issue, and store the actual pages outside the virtual directory structure and use either file handling or includes to output the actual page. This way the other pages can never be accessed via anything other than you one page script as the web server can see them othrwise.

alanpongAuthor Commented:
Thanks, Mouatts.

Can you help in the question :

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now