|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
Back button and resubmitting data
Hi.
I'm working on the submittion page. User fill's out the info clicks the submit button and all the info is stored in to sql database. All the info is transfered trough form fields. The problem is if the user then goes to some other page and click back button it inserts everything in to db again. How can I prevent this from happening? I was thinking of setting some variable in session on submittion page, then on next page checking if the variable is set. If it is submitting everything to db then "unsetting' the variable. Will this be a good way of doing this? EDIT: Ok I tried that and it works when user goes to next page then clicks back. But if the user clicks the back button to go to submittion page then forward again, it still resubmites everything. Thx. |
|
#2
|
|||
|
|||
|
I solved this problem in a rather crude way...
I chose three or four fields that make the information submitted by my users unique and then added a few lines in my code that check on my database if the information that is about to be submitted already exists. The question is, can you find two or three fields in your form that their combination is impossible (or at least highly improbable) to be identical between two different submissions? I don't know if this helps. It works ok on my application. daidalus13 |
|
#3
|
|||
|
|||
|
Thanks, yeah I think I will got that way too. Just thought there might be a more eligant way of doing it.
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > Back button and resubmitting data |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|