Home  >  Article  >  Backend Development  >  Solution to the problem that thinkphp verification code cannot be displayed_PHP tutorial

Solution to the problem that thinkphp verification code cannot be displayed_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:35:04927browse

php configuration file php.ini, search for extension=php_gd2.dll, and remove the semicolon in front;

1. Add a verify method to the module class to display the verification code

Copy the code The code is as follows:

Public function verify(){
// Import Image class library
import("ORG.Util.Image");
Image::buildImageVerify();
}

2. Use verification code in the form

Copy code The code is as follows:



3. Verification code refresh

Copy code The code is as follows:


4. Verification code verification

Copy code The code is as follows:

if($_SESSION['verify'] ! = md5($_POST['verify'])) {
$this->error('Verification code error!');
}

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/746868.htmlTechArticlephp configuration file php.ini, search for extension=php_gd2.dll, and remove the preceding semicolon; 1 .Add a verify method in the module class to display the verification code. Copy the code as follows...
Statement:
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