View Full Version : Problem with the back button !

06-13-2010, 09:44 PM
I've been testing my forms and they all seem to work OK now. However, I have noticed that when you press the back button, you can return to a form and in some cases re-submit it. Some of my forms will respond by saying this or that already exists in the database so there's not much a user can do. In other forms, eg one for getting a new password, you can go back and re-submit over and over and my script will keep sending new emailed passwords. I've searched around and there seems to be two schools of thought: one says the script is rubbish and shouldn't allow a re-submit and the other says that it's an argument for disabling the back button at that point.
Are there any generic solutions to this problem ?
Thanks - Songboy
PS I'm testing on my machine and when you go back, the previously typed data (apart from password dots) is always there. I'm not sure if this is supposed to happen or not.

06-14-2010, 02:03 AM
if you are using sessions you could get the ip address then either add that to the database and do a check or as you say only display the back button if new IP perhaps

06-16-2010, 09:38 AM
set a session based on the user who submitted the form first time round

check the session on every page and handle appropriately