教学之友,学习之友。

站长教学网

当前位置: 站长教学网 > 开源代码 > cms教程 >

修复dedecms设置验证码字符数长度没起作用问题

时间:2012-06-28 16:29来源:未知 作者:ken 点击:

设置织梦dedecms的验证安全设置>验证码字符数:超过或小于4都是无效的,需要手动修改include/vdimgck.php文件的源代码。方法如下:

修改以下红色部分即可,无效请留言^_^,还有记得了类型不能选择但单词,和验证码图片长度需要根据长度修改;该文为原创内容,转载注明,谢谢!

$config = array(
    'codelen'   => (int)$safe_codelen,
    'font_size'   => 14,
    'img_height'  => $safe_wheight,
    'word_type'  => (int)$safe_codetype,   // 1:数字  2:英文   3:单词
    'img_width'   => $safe_wwidth,
    'use_boder'   => TRUE,
    'font_file'   => dirname(__FILE__).'/data/fonts/ggbi.ttf',
    'wordlist_file'   => dirname(__FILE__).'/data/words/words.txt',
    'filter_type' => 5);

    //主要参数
    $codelen  = isset($config['codelen']) ? $config['codelen'] : 4;
    $font_size   = isset($config['font_size']) ? $config['font_size'] : 14;
    $img_height  = isset($config['img_height']) ? $config['img_height'] : 24;
    $img_width   = isset($config['img_width']) ? $config['img_width'] : 68;
    $font_file   = isset($config['font_file']) ? $config['font_file'] : PATH_DATA.'/data/font/ggbi.ttf';
    $use_boder   = isset($config['use_boder']) ? $config['use_boder'] : TRUE;
    $filter_type = isset($config['filter_type']) ? $config['filter_type'] : 0;

    //获取随机字符
    $rndstring  = '';
    if ($config['word_type'] != 3)
    {
        for($i=0; $i<$codelen; $i++)

(责任编辑:ken)
TAG标签: 验证码 dedems
顶一下
(1)
100%
踩一下
(0)
0%
------分隔线----------------------------
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
注册登录:不允许匿名留言,登录后留言无需输入验证码。
栏目列表
最新内容