Home  >  Article  >  Backend Development  >  How to modify the digital verification code displayed in dedecms portal template dedecms

How to modify the digital verification code displayed in dedecms portal template dedecms

WBOY
WBOYOriginal
2016-07-29 08:36:531298browse

I find it very annoying to enter the alphabetic 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));
}
Change It becomes
for($i=0;$i<4;$i++)
{
$rndstring .= chr(mt_rand(48,57));
}
This function generates random characters. If you see the numbers inside, It is to generate the range of character keyboard codes. The original one is
mt_rand(65,90). This 65 to 90 is the keyboard code 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, which sets the background color and text color of the generated image. . 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 represents pure blue.
255.255.255 means white.

The above introduces how to modify the digital verification code displayed in the dedecms portal template dedecms, including the content of the dedecms portal template. I hope it will be helpful to friends who are interested in PHP tutorials.

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