Home > Backend Development > PHP Tutorial > How to modify the numerical verification code displayed in dedecms_PHP tutorial

How to modify the numerical verification code displayed in dedecms_PHP tutorial

WBOY
Release: 2016-07-21 15:55:39
Original
903 people have browsed it

I find it very annoying to enter the alphabetical verification code, especially when I have to enter capital letters. So I found the file and modified it into a digital verification code.
Modify the file verification code file location
includevalidateimg.php
Find
for($i=0;$i<4;$i++)
{
$rndstring .= chr( mt_rand(65,90));
}
changed to
for($i=0;$i<4;$i++)
{
$rndstring .= chr(mt_rand( 48,57));
}
This function is to generate random characters. If you see that there are no numbers in it, it is to generate the range of character keyboard codes. The original one is
mt_rand(65,90), this 65 to 90 are the keyboard codes for the uppercase letters A to Z.
Now modified to (48, 57) represents the keyboard code from 0 to 9: mt_rand(48,57).
According to this theory, it is estimated that Chinese can be produced.
There is also
$bgcolor = ImageColorAllocate($im, 248,212,20);
$black = ImageColorAllocate($im, 0,0,0);
in this file is set to generate The background color and text color of the picture. The three numbers represent the red, green, and blue values ​​of the color. The range is 0 to 255,
For example,
0, 0, 0 represents black,
255, 0, 0 represents pure red,
0, 255, 0 represents pure green,
0, 0,255 means pure blue.
255.255.255 means white.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/318267.htmlTechArticleI find it very annoying to enter the letter verification code, especially I have to enter capital letters. So I found the file and modified it into a digital verification code. Modify the file verification code file location includevalidateimg.php...
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template