search
HomePHP LibrariesVerification code libraryCustomized php verification code class
Customized php verification code class

Customized php verification code class

Create verification code image:

Create canvas (__construct function)
Set canvas background ($this->set_bgcolor();)
Get a random string ($this->get_randnum ();)
Write text to the picture (imagestring function)
Add interference points/lines ($this->set_ext_line(); $this->set_ext_pixel();)

Output picture

When instantiated without parameters, the default is a four-digit regular verification code image of 60*25 size

Method to detect verification code on form page, compare whether $_SESSION[an] is equal to $_POST[Verification code text box ID]

Disclaimer

All resources on this site are contributed by netizens or reprinted by major download sites. Please check the integrity of the software yourself! All resources on this site are for learning reference only. Please do not use them for commercial purposes. Otherwise, you will be responsible for all consequences! If there is any infringement, please contact us to delete it. Contact information: admin@php.cn

Related Article

php verification code class php verification codephp verification code class php verification code

25Jul2016

php verification code class php verification code

Verification code class, php verification code class_PHP tutorialVerification code class, php verification code class_PHP tutorial

12Jul2016

Verification code class, php verification code class. Verification code class, php verification code class. Familiar with related image processing functions, simple verification code class 1 // code class 2 class ValidateCode { 3 private $charset = 'abcdefghkmnprstuvwxyzABCDEFGHKMNP

PHP Chinese alphanumeric verification code class, customizable font_PHP tutorialPHP Chinese alphanumeric verification code class, customizable font_PHP tutorial

21Jul2016

PHP Chinese alphanumeric verification code class, customizable font. In actual project development, verification code problems are often encountered, such as login pages, message pages, and registration pages. The principle of verification code is very simple: use the GD library to create an image. The image must of course be

Example of php verification code (GD library generates verification code)Example of php verification code (GD library generates verification code)

25Jul2016

Example of php verification code (GD library generates verification code)

Use GD library to do verification code in php, phpgd library verification code_PHP tutorialUse GD library to do verification code in php, phpgd library verification code_PHP tutorial

12Jul2016

In php, GD library is used for verification code, and phpgd library is used for verification code. Use GD library to do verification code in php, phpgd library verification code php require_once 'string.func.php';//Use GD library to do verification code/** *Add verification text* @param int $type * @param int $length */function

See all articles