Home > php教程 > php手册 > thinkphp验证码显示不出来的解决方法

thinkphp验证码显示不出来的解决方法

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 20:23:38
Original
1529 people have browsed it

这篇文章主要介绍了thinkphp验证码显示不出来的解决方法,需要的朋友可以参考下

php的配置文件php.ini,,搜索extension=php_gd2.dll,去掉前面的分号即可;

1.在模块类中增加一个 verify 方法来用于显示验证码

复制代码 代码如下:


Public function verify(){
    // 导入Image类库
    import("ORG.Util.Image");
    Image::buildImageVerify();
}

2.表单中使用验证码

复制代码 代码如下:



thinkphp验证码显示不出来的解决方法

3.验证码刷新

复制代码 代码如下:



4.验证码验证

复制代码 代码如下:


if($_SESSION['verify'] != md5($_POST['verify'])) {
    $this->error('验证码错误!');
}

Related labels:
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
Why thinkphp has better performance than laravel?
From 1970-01-01 08:00:00
0
0
0
ThinkPHP Why use composer?
From 1970-01-01 08:00:00
0
0
0
thinkphp versions supported by php6
From 1970-01-01 08:00:00
0
0
0
thinkphp upload files
From 1970-01-01 08:00:00
0
0
0
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template