Jump to content

Bouble Submision Issues


phpretard

Recommended Posts

I have a form that when is completed submits the info into a DB.  No problem

 

When the form is complete the header redirects you to a new page.  If you click the back button you of course get this page has expired but if you click yes to refresh it resubmits the same infor to the DB.  Now I have Duplicate entries with the basically the same info.

 

How could I prevent this issue?

Link to comment
Share on other sites

One common way is to submit the info to a popup or just do validate to check for double-submission attempts.

 

Set a session variable that doesn't accept the post data if the user has already sent in the form..

 

tons of ways.

Link to comment
Share on other sites

Use the following pattern:

 

form -> submission page -> page to be forwarded to

 

Have all the processing done on the submission page, with a redirect to the page to be forwarded to at the end. Since all the processing is done on the submission page behind the scenes on the server, the user's history will only show the form page, and the page to be forwarded to. This way when the user clicks back, they go back to the form, and nothign is submitted.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.