in reply to Perl and Database Input
What you should do is create the entry when you process the first form and update the entry when you process the additional forms.
However, that can provide a humunguous security hole for people to explore your database.
Let's say you create the record, as id 1234, and then stick hidden field 1234 into each of the additional forms, to enable updating the records. Then a malicious child might look at the page source, alter the hidden field to values in the range 1..1233, and view information about existing members, or update the data in undesirable ways. It would not be good if someone updates possitive account balances to negative, or vice versa.
Since you say these are questionaires, people should only be on the four pages for a few minutes, no more than an hour or two. I would suggest having one table, for incomplete interviewees, and another, possibly even in a different database, for complete ones.
When someone fills out a form, they get a random number between 1 and a gazillion as a key. When they fill out the additional pages, look up the key in the key_to_memberId table, obtaining the id for their incomplete record, which can now be updated. Random hunting will have limited success, since the key_to_memberId table is very sparsely populated.
Once an hour, a different script checks for complete interview records, and moves them to a different table, in a different database. Now complete records are safe from accidental or malicious web access. At the same time, any incomplete questionaires older than a couple of hours can be deleted, to protect them from snoopers. Don't forget to trim obsolete entries from key_to_memberId.
Now records are only exposed to web probing for a limited time, and access is controlled.
Don't forget to verify the key returning from the web page contains only digits, no '123; rm -rf'.
--
TTTATCGGTCGTTATATAGATGTTTGCA
|
|---|