Welcome Guest, Not a member yet? Register   Sign In
Refreshing the page inserts the code into database
#1

[eluser]Ulhas[/eluser]
When i am refreshing page previous entry is inserting into database.May i get any solution??Please do help me...
#2

[eluser]GSV Sleeper Service[/eluser]
redirect to another controller/method after performing the db insert
#3

[eluser]Ulhas[/eluser]
Thanx for rpl...but i found a better way that to get latest row of record and checking with recent post if matches then displays message,else inserts into database>>>
Do temme how was that???
#4

[eluser]rogierb[/eluser]
I create a unique value for each form call and store that in the session.(on form_open)
On insert/update I check if that unique value is valid.
If it is valid, I do the database stuff, remove the unique value from the session and redirect or refresh.
If it is not valid, I redirect.

This way even the backbutton can't break the update/delete and POST cannot be duplicate when users click the submit button twice.
#5

[eluser]Ulhas[/eluser]
Thnx rogierb..i really liked your idea....Will try it.but it increases..a column in database increases..it will produce an extra load..what do you say??
#6

[eluser]mattpointblank[/eluser]
No, the unique value is just stored in the session, not the database.




Theme © iAndrew 2016 - Forum software by © MyBB