-5

The scoring software I am working on should submit and store date in a DB. However re- submitting an action is not allowed in this sport. So I want to disable the page back functionality to avoid re-submitting the same (or revised) data. Any php or javascript solution is welcome. I do realize the opinions posted that the page back function should not be disabled principally but in this case it would be very helpful however.

Marcin Orlowski
  • 72,056
  • 11
  • 123
  • 141
MdB
  • 1

1 Answers1

0

Use $_SESSION to avoid re-submitting: Set a session variable on submit and if it's set don't process a second submit.

However the user could remove browser cookies and re-submit. If your casuistic needs to prevent it too, store the submitting ip in the database.

PS: About refresh, use Post/Redirect/Get: https://en.wikipedia.org/wiki/Post/Redirect/Get

Javier S
  • 379
  • 3
  • 13