Welcome Guest, Not a member yet? Register   Sign In
Duplicate records saved on Click of save button
#1

[eluser]Unknown[/eluser]
I am using php and mysql database, my problem is that in my page there is two field first is title and second is upload photo. its working perfectly, But when i press f5, then same entry saved in again.I refresh the page or press f5 then entry is saving in database and even seen in grid. so how to prevent my page to save the record again until and unless i press on save button.

thanks in advance
#2

[eluser]WanWizard[/eluser]
If you reload a page that contains a posted form, the browser will post it again. This is how it works.

I include a random ID in a hidden field in every form. When the form is posted, I first check in an array stored in the session if it's an ID I have generated. If not, it could be a CSRF attack. If it is, I check if it was already used. If so, I generate a 'double post' message, and don't accept the post.




Theme © iAndrew 2016 - Forum software by © MyBB