Prevent PHP script from being flooded

后端 未结 5 2062
失恋的感觉
失恋的感觉 2020-12-01 15:43

I want to prevent my script, from being flooded - if user hit F5 it is executing the script every time.

I want to prevent from this and allow one script execution pe

5条回答
  •  猫巷女王i
    2020-12-01 16:09

    1. Store the last execution time of your script in a database or a file.
    2. Read from that file/database and compare to the current time.
    3. If the difference is under 2 seconds, terminate the script.
    4. Else, continue normally.

提交回复
热议问题