I'm sure there are many ways...
a few off the top of my head.
a). if there is some field or combination of fields that guarantee
uniqueness then you can test for their existence before you insert.
b). When you insert the first time set some session variable to
something, and then don't insert if that session variable exists.
c). have some middle page that does your insertion and then immediately
redirects to another page which displays results, but has not more POST
data associated with it, so refreshing that page will not cause a
re-post of your data.
Tamkhane, Pravin wrote:
I am a PHP newbie. I am using HTTP POST request to send some data to
Apache and then using MySql to store that information. Once
information is stored in MySql DB successfully, I display a result
page. But the problem I am facing is that, if I refresh the result
page displayed after database updation, the information is stored
again in database which I don't want to. Please guide me on how I can
avoid duplication of information in database on refreshing the page.
Thanks in advance!
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php