in reply to Accumulate results from multiple CGI calls for browser viewing
As others have said, the problem is that when the user visits the page again, your script is run from scratch, and doesn't have any information about what happened last time it ran.
The most common way to deal with this is with sessions. When a user runs your script for the first time, generate some kind of unique identifier for them. Either store that as a hidden CGI parameter, put it into the URL as a parameter or path component, or stick it in a cookie. When your script runs again, retreive that token; you can use it to track the same user between multiple runs of your script, and do things like store information about previous runs in a file named for the session key.
There are lots of modules to do this. Search CPAN for Session for a few.
|
|---|