The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Taking 3 pages into one page

I have three pages in PHP that I would like to make into one. The first page takes the users info and submits it to the second page. The Second page takes the users info and displays it for their conformation. They user accepts the info and the info is sent to the third page which adds it to the MySQL database. I know its not the cleanest code you have ever seen.

Sorry. I should be specific. I was referring to bjcffnets. The method he used was what I was looking for but I cant get it to work yet. Iím sure it will work once he reviews his code and figures it out. Thanks for your help Mandes. Itís very much appreciated.

I am open to your method. As far as I can see they work almost the same.

There must be something wrong with the code. When I use it, it never gets to the submit=1 part. Here is what happens:

User fills out addmain.php and hits submit.
taken to addmain.php?usersubmit=1 but forwarded to the old forward page.

Im going to restart the server and see if that fixes the problem. Its looks like a chache problem to me. Something to do with the javascript redirect I was using I think. I will let you know how it goes. Thanks again!

One question i have is; how can I stop the information from being resent to the database after the user has already added it. Currently, if the user hits refresh after they have submitted it will add a double post to the database.

I cant kill the session because that will make them re-login. Any suggestions?