Home > Backend Development > PHP Tutorial > 用户在某个时间段内操作频繁提示输入验证码,这个该怎么实现?

用户在某个时间段内操作频繁提示输入验证码,这个该怎么实现?

WBOY
Release: 2016-06-06 20:20:59
Original
2018 people have browsed it

用户发送私信的功能,假设用户在3分钟内连续发了10条私信,则系统提示输入验证码,这个在后端该怎么实现?

回复内容:

用户发送私信的功能,假设用户在3分钟内连续发了10条私信,则系统提示输入验证码,这个在后端该怎么实现?

使用redis incr user:acc expire 180
如果user:acc大于3拒绝

1,发送之前检查3分钟之内发送的条数,用sql
2,session里记录最近10条发消息的时间,用循环数组

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template