Rewiring the Back Button, Part 2
By TJ Sylvester
I think you'll find that the third and fourth pages are fairly simple. The third page, redirect.asp is responsible for handling any form processing.
For example, if you have your users enter a value in form.asp that needs to be inserted into a
database, in the third page, redirect.asp, this processing needs to occur. redirect.asp
also redirects the user to the confirmation page after any needed form processing is completed.
A small note, the redirect.asp page is set to refresh to confirmation.asp in one second, which is a small delay.
The reason behind this: Internet Explorer.
If you set the time to zero seconds, it will ignore redirect.asp and head straight back to form.asp.
|
The fourth page (confirmation.asp) will provide a confirmation of the form submission.
This page simply displays a Thank You message, or some sort of confirmation.
|
Now that you have the code, try it out.
Open default.asp and click the form link. On the form.asp page, click submit.
If you noticed, the form processes itself, then redirects to redirect.asp.
The purpose of redirect.asp is to create an HTML page for the back button to hit while a
META tag to refresh to confirmation.asp. Using the META tag to refresh
to another page will load a fresh instance of that page.
Confirmation.asp now checks for the session variable. If it is present, it will display the
confirmation and the kill the session variable. If a user clicks the back button, redirect.asp
is loaded up which will send them directly back to confirmation.asp. This time, however, the
session variable is empty and we are redirected to default.asp.
Happy Programming!
Attachments:




