Home > Backend Development > PHP Tutorial > php 表单1分钟内用户最多可提交3次,多于3次则10分后才能再次提交,不用数据库

php 表单1分钟内用户最多可提交3次,多于3次则10分后才能再次提交,不用数据库

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 20:20:59
Original
1912 people have browsed it

cookie或者session都可以,具体点的思路,有具体点的代码更好

回复内容:

cookie或者session都可以,具体点的思路,有具体点的代码更好

我给你代码吧

<code>function check_allow_submit() {
    $now = time();
    if(isset($_SESSION['last_submit_time']) && !empty($_SESSION['last_submit_time'])) {
        if($now-$_SESSION['last_submit_time'] </code>
Copy after login

在请求的处理函数中用$_SESSION[req_time]记录就可以了,请求进入时先进行判断,通过后处理相关任务,处理完毕后$_SESSION[req_time]+1

@kumfo 你的联系方式留个呗

Related labels:
php
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template