FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

How to avoid reload button rewriting database?

 


ptolomeo
I am making a php script to store people data in a my sql database. I have the problem that when the page is reloaded (with the browser's reload button), as the URL parameter remain the same, the data is re entered to the database.

I was thinking that may be it is possible to avoid this by clearing the URL parameters after first uploading data, but don't know how to do that.

Could someone guide me on that please?
Peterssidan
If you redirect from the page where the data was sent, to the same or another page you will not face this problem as far as I know.
BlueVD
Like ptolomeo said, redirecting to another page or the same page without params works. Also, you can check to see if the same data exists in the database and if so, don't insert it.
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.