• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Prevent Back Page

 
Praveen Banthia
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I have a very common problem the user is hitting submit score and score is displayed on a new screen . Now user go backs and hits enter again then the score is getting doubled ie(the score is calculated again) how can I write code on server side such that if user presses back button on browser he redirected to welcome page and not the previous page which has the game or( redirect him to the same page)
need solution for both types as I have not decided how will I implement it.
Please no advice on disabling browser back on web browser not an acceptable solution as it can be subverted very easily.
 
Amit Ghorpade
Bartender
Posts: 2854
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Praveen Banthia wrote: how can I write code on server side such that if user presses back button on browser he redirected to welcome page and not the previous page

You cannot write any server side code for the browser back button. The back button is a browser event and no request is made to the server unless there is a reason to make one.
You can use Javascript for the browser. For the page in question, you can ask the browser not to cache it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic