Home >CMS Tutorial >DEDECMS >How to modify the style of DedeCms verification code

How to modify the style of DedeCms verification code

(*-*)浩
(*-*)浩Original
2020-01-13 15:36:093445browse

How to modify the style of DedeCms verification code

Modify the file verification code file location include\validateimg.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 no numbers inside, it is to generate a character keyboard. The range of codes is originally mt_rand(65,90). This 65 to 90 is the keyboard code for the capital 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.

Also,

$bgcolor = ImageColorAllocate($im, 248,212,20); 
$black = ImageColorAllocate($im, 0,0,0);

in this file is used to set 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,

such as

0,0,0 表示 黑色, 
255,0,0 表示纯红, 
0,255,0 表示纯绿, 
0,0,255 表示纯蓝。

The above is the detailed content of How to modify the style of DedeCms verification code. For more information, please follow other related articles on the PHP Chinese website!

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