How to modify the digital verification code displayed in dedecms
Source: Internet
Author: User
Dedecms shows the modification method of the digital verification code. it is annoying to enter the letter verification code, especially uppercase letters. Then find the file and modify it to a digital 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 ));
}
Change
For ($ I = 0; $ I <4; $ I ++)
{
$ Rndstring. = chr (mt_rand (48, 57 ));
}
This function generates random characters. if you see no number in it, it is the range of the character and keyboard code to be generated.
Mt_rand (), which is the keyboard code from uppercase letters A to Z.
Now, the value is changed to (), which indicates the keyboard code from 0 to 9: mt_rand ).
According to this theory, it is estimated that Chinese characters can be generated.
In this file
$ Bgcolor = ImageColorAllocate ($ im, 248,212, 20 );
$ Black = ImageColorAllocate ($ im, 0, 0 );
Set the background color and text color of the generated image. Three numbers indicate the values of red, green, and blue. The value range is 0 to 255,
For example
0, 0, 0 indicates black,
255, 0, 0 indicates pure red,
0,255, 0 indicates pure green,
0, 0, 255 indicates pure blue.
255.255.255 indicates white.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.