1 Vote Vote

back button in dynamic application

Posted by topdog 339 days ago Questions| application page button All

Well, my problem is what the title says. I have build a small application (php + mysql), to test my skills in an e-commerce environment - 6 pages in total.

Each page after the 1st, relies on an id to retrieve/save data. This id is passed usually as hidden form field between pages.

On top of each page i have a small script that checks in what state is the selected id (2 checks actually.... a) if user has reached the last page/step of application and b) if a fantastic payment has been completed for this user) - if both of these conditions are valid, then i redirect user to a thank you page, stating that his process is already completed and he can choose to start over.

Yet i have problems with hitting the back button on my browser. Hitting the back button once, works good - validation check forces the redirect i have implemented in my code.

But hitting the back button fast for 2 or more times, break this script - leading to lost records in my database - in live environment these will be purchases.

So my question is this: what measures should i take to prevent the "back hitting user" of duplicating/deleting/overwrite data records in the application. I am looking for ideas and strategies.

Originally asked by: andrew on Stack Overflow

Discuss Bury


Who Voted for this Question