What is the best way to prevent double clicking on a $_POST submit form on browser games?
For example, a player collecting interest from the bank. I have a code that uses a timestamp to update itself when clicked, but it can still be clicked rapidly in succession and rake up extra interest regardless of the timestamp.
I tried Post/Redirect/Get method and saving tokens in a session, but for some reason neither of these worked for me. I could just be doing them incorrectly.
I also tried Javascript, but that's easy to get around (just turn off JS).
So I'm wondering whether I'm just doing it wrong and should keep trying, or if these methods actually aren't viable for petsite/SIM features like banks? What is the best method to prevent double clicking and resubmission that someone in my situation should learn for their game?
For example, a player collecting interest from the bank. I have a code that uses a timestamp to update itself when clicked, but it can still be clicked rapidly in succession and rake up extra interest regardless of the timestamp.
I tried Post/Redirect/Get method and saving tokens in a session, but for some reason neither of these worked for me. I could just be doing them incorrectly.
I also tried Javascript, but that's easy to get around (just turn off JS).
So I'm wondering whether I'm just doing it wrong and should keep trying, or if these methods actually aren't viable for petsite/SIM features like banks? What is the best method to prevent double clicking and resubmission that someone in my situation should learn for their game?