按钮每小时限制一次点击

编程入门 行业动态 更新时间:2024-10-25 10:21:19
本文介绍了按钮每小时限制一次点击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个问题这个简单的系统,我可以做一个按钮,限制在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

更多推荐

按钮每小时限制一次点击

本文发布于:2023-11-27 07:05:43,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1637076.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:每小时   按钮

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!