How to prevent data resending when updating (F5) in PHP? [duplicate]

0

Good evening guys, I'm creating an online game where the user has the option to use an item to recover HP. When you click Consume, an alert appears on the screen informing you that the item has been consumed and that HP has been recovered.

The problem, as you can imagine, is that every time I press F5 the HP continues to increase and the alert appears again. I tried to use unset ($ _ POST ['']) to clean what was chosen by the user but did not work.

Thanks for the help right away.

    
asked by anonymous 10.05.2018 / 03:56

0 answers