How can I stop PHP sleep() affecting my whole PHP code?

后端 未结 6 2072
北荒
北荒 2020-12-01 20:21

So, on my arcade, howlingdoggames.com. I have a points system that gives you a point every time you visit a page with a game on, now, to reduce abuse of this, I would like

6条回答
  •  庸人自扰
    2020-12-01 21:05

    Instead of blocking the script, save the current time in the session, don't add the points and let the page render. Then on later page views if you see that the saved time in session is older than 45 seconds, add the points, store them wherever you need, and clear the time.

提交回复
热议问题