That was a nifty one 😉
Another way would be to either set cookies with the data (unless they're huge...) or register the data with the session, which is one of the reasons sessions were constructed.
Or, why not have all form-data on one page? This would be the simplest way to avoid garbage piling up in db, because the user would then commit himself when clicking submit.
A workaround could also be to add two fields to db: control_time and commit.
Then you could insert a time() into control_time when user starts, and have the commit (SET 'y','n') be set to n as long as the two first pages of the form is in progress, then set it to y when the user finally posts his last page.
Then add at top of indexpage or any page thats bound to be reloaded often:
## Give the user ample time to finish filling in ##
$timelimit = time() - 5000;
## Delete old garbage ##
$garbageCollect = mysql_query("delete from table where control_time < '$timelimit' and commit = 'n'");
knutm