in reply to Storing sequence of cgi states

Are you tracking sessions? If so, you can store your data from each form in your session storage (Cookies, database, flat-file, etc).

Let's say you're using cookies to toss the browser a session ID. Then, you're storing all session data in a file. (That's the way our web store handles shopping carts here at work.)

You can then put data in the cart like this:

open DATAFILE ">>$datadir/$sessid"; foreach $thing (keys %formdata) { print DATAFILE "$thing: $formdata{$thing}\n";

Then, you can suck that file in at the beginning of your CGI script and have the data in memory. A quick hack would be to have a hidden input tag on each form set to true. So, if someone needs to go back to form 1, they can click on the form1 link and you do this in your script:

if ($formToShow eq 'form1') { if ($sessionData{form1} eq 'True') { #Populate form fields here } else { #display unpopulated form here }

I hope that made sense.