Not allow POSTDATA to be sent on browser refresh
Moderator: General Moderators
- seodevhead
- Forum Regular
- Posts: 705
- Joined: Sat Oct 08, 2005 8:18 pm
- Location: Windermere, FL
Not allow POSTDATA to be sent on browser refresh
I have a php file that has a form that submits input through the POST method to itself. Once the page is reloaded after the form is submitted... users on this particular page are often hitting refresh in their browsers for various reasons, which will ask them if they want to resubmit the POSTDATA. Is there some code that I can put in my php file that will tell the browsers that even if the user hits refresh on the browser, not to ask or even think about the form that was just submitted? Thanks!
yeah but my post was not for that problem...
what you need to do is using a 3rd page to prevent that...
and if yu have duplicate entrys becouse the refresh is sending again the same DATA and the script is inserting data into the DB, i say check first if there is first the same name in the DB, in case yes, the script send ERROR message saying the email or name is already registered, and dont insert the DATA into DB...
what you need to do is using a 3rd page to prevent that...
and if yu have duplicate entrys becouse the refresh is sending again the same DATA and the script is inserting data into the DB, i say check first if there is first the same name in the DB, in case yes, the script send ERROR message saying the email or name is already registered, and dont insert the DATA into DB...
Much like the other thread, the solution is to break that one page into three, each doing a seperate task:
Post-Redirect-Get pattern.
Fixes the problem nicely.
Post-Redirect-Get pattern.
Fixes the problem nicely.