Home > CMS Tutorial > DEDECMS > body text

How to modify the style of DedeCms verification code

(*-*)浩
Release: 2020-01-13 15:36:55
Original
3344 people have browsed it

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)); 
}
Copy after login

Changed to

for($i=0;$i<4;$i ) 
{ 
$rndstring .= chr(mt_rand(48,57)); 
}
Copy after login

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);
Copy after login

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 表示纯蓝。
Copy after login

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!

Related labels:
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!