Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


How to ensure page sequence?

Posted on 1999-07-08
Medium Priority
Last Modified: 2013-12-25
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?
Question by:alanpong
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 11

Accepted Solution

mouatts earned 400 total points
ID: 1863880
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.


Author Comment

ID: 1863881
Thanks, Mouatts.

Can you help in the question :


Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
Suggested Courses

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question