PHP 实现半个月内只能提交一单数据
2015-07-03 22:40
633 查看
//判断本月该手机提交次数 $telnum=sql("s", "list", "time", "where tel=".$_POST['tel']." order by id desc"); if($telnum){ $telrow=firstrow($telnum); $one = strtotime($telrow['time']);//开始时间 时间戳 $tow = strtotime(date('Y-m-d H:i:s'));//结束时间 时间戳 $cle = $tow - $one; //得出时间戳差值 $d = floor($cle/3600/24); //得到天数 if($d < 15){ echo "<script>alert('半个月内此手机号码只能提交一次!'); history.back(); </script>"; exit(); } }
相关文章推荐
- array_sort php
- php如何输出中文json格式字符串
- ThinkPHP RBAC功能小结
- 虚拟账号ftp服务器
- PHP中CGI,FastCGI,PHP-CGI与PHP-FPM对比
- php的基础总结
- ThinkPHP 5.数据库基本操作
- ThinkPHP 4.使用Session
- PHP 中 Failed to load resource: the server responded with a status of 500 (Internal Server Error)
- php使用face++实现一个简单的人脸识别系统
- WindowManager.LayoutParams(上)
- ZeroMQ + libevent in PHP
- php遍历多维数组改变数组的值
- ThinkPHP3.2创建view并调用view
- PHP 报告分拣和生产理念
- ecshop安装出现问题集合(php版本偏高)
- PHP如何过滤这样的空白字符?
- php中的json_encode函数
- PHP基本语法以及和Java的区别
- php缓存技术(减少数据库服务器压力)