thinkPHP快速创建验证码
来源:互联网 发布:python保存文件 编辑:程序博客网 时间:2024/05/21 23:26
1.在方法中/commom/function
/*验证码检测*/function check_code($code){ $verify = new \Think\Verify(); return $verify->check($code);}
2.在控制器中
public function selfverify(){ $config = array( 'length' => 4, // 验证码位数 ); ob_clean(); $Verify = new \Think\Verify($config); $Verify->entry();}
if(isset($_POST['code'])){ $code = $_POST['code']; if(check_code($code) === false){ $this->error('验证码错误','/Admin/Login',1); }}
3.在模版中<img style="height:36px" src="{:U('/Admin/Login/selfverify','','')}" onclick="this.src='{:U('/Admin/Login/selfverify','','')}?d='+Math.random();" />
1 0
- thinkPHP快速创建验证码
- THINKPHP快速创建分页
- ThinkPHP创建微信回调服务器验证
- thinkphp验证码的验证
- thinkphp 验证码
- thinkphp验证码问题
- ThinkPHP验证码
- ThinkPHP验证码
- ThinkPHP 验证码
- thinkphp验证码更改
- thinkphp 验证码 Verify
- ThinkPHP验证码
- ThinkPHP验证码
- thinkphp验证码错误
- thinkphp验证码
- thinkphp 验证码
- Thinkphp生成验证码
- 【ThinkPHP】验证码
- 二十、组合模式Composite(结构型模式)
- DFS序+主席树 51Nod1681 公共祖先
- B树、B-树、B+树、B*树
- 使用selenium报错InvalidElementStateException
- jdk的动态代理---学习笔记
- thinkPHP快速创建验证码
- C++中虚析构函数的作用
- 9项目三动态分配空间储存
- 架构师思维的十个学习步骤
- 七牛上传图片(javascript)
- hough变换是如何检测出直线的
- 分析某实习招聘网站上海地区的平均实习工资
- 01背包——HDOJ2602拾骨者
- 远程过程调用(RPC)实现原理