There are many methods to such madness.
Take a look at one of
merlyn's
web technique columns.
And if you are new to web programming, you could benefit from reading over
Ovid's Course.
Do a search for maintaining "state" or "session" on perlmonks. There are plenty of resources.
-xtype