Browser sends Post data again
Posted: Mon Aug 22, 2005 9:41 am
In my web app I use several forms that send data using post, which is then inserted into a database. In most instances the data is unique and cannot be inserted into the database twice, but I have one table where datasets don't need to be unique. I could of course add an auto_increment index field, and then anytime when the form is displayed, find the highest stored index (the next auto_increment would supply) and put it into the form data. Then, when the data is to be stored, I could compare the two indices and duplicate entries could be denied at this stage.
However, I'd like to solve this another way.
The form forwards to a php file (the same, actually) which stores the data into the database and then sends a Location-Header to reload the page without sending the post data again. This works as expected on Internet Explorer, but Mozilla Firefox asks the user if the post data should be sent again, and if he clicks OK, the data is stored again into the database.
My actual question now is the following:
Can this be done using the second approach (and what do I have to do different to make it run on Mozilla Firefox, if so), or do I need to do use the first method?
Alternative ways are ok, too
Thanks in Advance,
OregonGhost
However, I'd like to solve this another way.
The form forwards to a php file (the same, actually) which stores the data into the database and then sends a Location-Header to reload the page without sending the post data again. This works as expected on Internet Explorer, but Mozilla Firefox asks the user if the post data should be sent again, and if he clicks OK, the data is stored again into the database.
My actual question now is the following:
Can this be done using the second approach (and what do I have to do different to make it run on Mozilla Firefox, if so), or do I need to do use the first method?
Alternative ways are ok, too
Thanks in Advance,
OregonGhost