本文介绍了按钮每小时限制一次点击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个问题这个简单的系统,我可以做一个按钮,限制在php / sql或其他每小时一次点击?每个ip没有限制。但对于所有这将像一个实时预订系统,任何人都可以帮助我?
i have a question With This simple system, i can make a button with a limit of one click per hour in php / sql or other? no limit per ip. but for all It would be like a reservation system in real time, anyone can help me? But only the script of the button with 1 click limit per hour for all.
推荐答案你可以存储数字的mySQL列中的点击,并在每次用户点击按钮时增加,然后检查点击是否在过去1小时的间隔内,如果是,请告诉他们必须等待。
You can store the number of clicks in a mySQL column and increment it every time a user clicks the button and then check if the click falls in the past 1 hour interval and if so, tell them they have to wait.
这样的东西:
select count(*) as clicks_in_the_past_hour from table where click_time >= now() - interval 1 hour更多推荐
按钮每小时限制一次点击
发布评论