Page 1 of 1
Prevent Insert on Refresh
Posted: Wed Oct 10, 2007 5:34 am
by shivam0101
Whenever i refresh a new row is inserted. How to prevent this?
Posted: Wed Oct 10, 2007 6:05 am
by Stryks
Just out of interest, when you hit refresh, does your browser say something like, "The page you are trying to view contains POSTDATA ... etc etc etc."?
Or just reloads and writes a new row?
Also, it would help if we can see the row creation code from the start of the page in question. Well .. from the start to the row creation code.
Cheers
Posted: Wed Oct 10, 2007 9:17 am
by shivam0101
The page cannot be refreshed without resending the data ----warning
Posted: Wed Oct 10, 2007 11:54 am
by feyd
If you write your form with a one-time use only token that the server looks for, the server wouldn't accept a second submission without getting a new token.
Posted: Wed Oct 10, 2007 12:04 pm
by John Cartwright
Another option is to redirect using header() immediately after the form submission.
Posted: Wed Oct 10, 2007 12:06 pm
by s.dot
POST to a different page that processes, REDIRECT back to the page, using GET to retrieve relevant data if necessary.