One solution is to put an IF statement around the routine that sends the mail and have it check for the existence of a temporary file that is created with the results of page 1.
When you submit the first page the temporary file will not exist so...
If the file does not exist then you assume it's page 1, create the temporary file and display page 2.
When you submit the second page the temporary file will exist so...
If the file exists then read it, append the results of the second page to it, delete the temporary file, send the mail and display the thank you page.
You may have to transfer the fields from the 2 pages to a common array that the script already uses as well as make a few minor modifications here and there but that's the basic idea and here's the basic flow:
if ( -e 'temp' ) {
&readtempfile;
&putpagestogether;
unlink temp;
&sendmail;
print "Location: [mydomain.com...]
} else {
&writetempfile;
print "Location: [mydomain.com...]
}
Now, that works great if there's only one person in the world using your form at any given time but that's highly unlikely so what you'll need to do is to actually give the temporary file a unique filename with a cookie for each visitor, and check for the existence of that cookie to get the name of the individual temp file that has that visitor's page 1 results instead of the existence of the static temporary file used in the example given above.
In other words, you're actually creating a shopping cart application.
If you don't do that then 2 visitors that are in the forms at the same time will be stepping on each others page 1.
There's a cookie driver routine I wrote for another topic in this forum which should help you with the cookie portion.
Good luck!