防灌水该怎么限制

WBOY
Release: 2016-06-13 11:50:28
Original
1326 people have browsed it

防灌水该如何限制?
我先说下需求,为了防止用户发帖过于频繁,要限制隔多久才能再发。现在想到的方法有,1.使用数据库包括每个用户最后的发帖时间,然后判断。2,使用缓存,memcache,设置缓存过期时间为间隔的时间。到底有什么好的方法可以做到,在禁止发帖的时间内,还要提示你可以隔多少时间再发帖。。
------解决方案--------------------
最后发帖时间戳+30秒-当前时间戳  就是剩余时间
------解决方案--------------------
用数据库或memcache记录吧,session 与 cookie记录效果不大。一清掉就没了。

Related labels:
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!