如何修改DedeCms验证码的样式?想改改就用这个方法!

    修改文件验证码文件位置include\validateimg.php
    找到
    for($i=0;$i<4;$i)
    {
    $rndstring.=chr(mt_rand(65,90));
    }
    改成
    for($i=0;$i<4;$i)
    {
    $rndstring.=chr(mt_rand(48,57));
    }
    这个函数是产生随机字符,看见里面的数字没有,它就是要产生字符键盘码的范围,原来的是
    mt_rand(65,90),这个65到90是大写字母A到Z的键盘码。
    现在修改为(48,57)表示0到9的键盘码:mt_rand(48,57)。
    按照这个理论,估计能产生中文吧。
    还有这个文件里面的
    $bgcolor=ImageColorAllocate($im,248,212,20);
    $black=ImageColorAllocate($im,0,0,0);
    是设定生成图片的背景颜色和文字颜色的。三个数字表示颜色的红,绿,蓝色值。范围为0到255,
    比如
    0,0,0表示黑色,
    255,0,0表示纯红,
    0,255,0表示纯绿,
    0,0,255表示纯蓝。
    255.255.255表示白。

Copyright & Disclaimer: If you find copyright issues, please provide relevant information and email us at [email protected], we will communicate promptly and handle removal.

Except for specially marked original content on abcdlink (https://www.abcdlink.com) all other content is reposted by users, and opinions/copyright are unrelated to this site.