I've looked everywhere for an answer, but I can't seem to find a description of a nice way to do this.
I'm writing a perl / cgi script that has a number of views. Let's say you can move through web pages in the following sequence:
View 1 -> View 2 -> View 3 (password-protected)
View 3 is password-protected. If you're not logged in when you request it, the script redirects you to the login screen. So basically your path looks like this:
View 1 -> View 2 -> Login -> View 3
Now, how do you come back from View 3 to View 1. Would I store this sequence in a hidden variable and update it for each view? It's easy to remember just the last view, but it doesn't work beyond 2 screens. If I'm in View 3, I remember that the last view was View 2, but I don't know what comes before View 1.
Does anyone know of a nice and clean way to program this? Any examples of code? The code I've got is a mess - I would hate to maintain it, so I need to find a cleaner solution.
Thank you,
Alex
In reply to Storing sequence of cgi states by relax99
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |