search
HomeCMS TutorialDEDECMSWhat should I do if the dedecms background login verification code is not displayed normally?

What should I do if the dedecms background login verification code is not displayed normally?

前言:

在登录dedecms后台时,经常遇到如下三种问题:

1、后台验证码不显示

What should I do if the dedecms background login verification code is not displayed normally?

2、后台验证码不正常显示

What should I do if the dedecms background login verification code is not displayed normally?

3、后台验证码不正常显示

What should I do if the dedecms background login verification code is not displayed normally?

解决方法:

1、取消后台验证码功能

因为没有验证码 不能进后台 所以修改php文件源代码:

方法一:

打开dede/login.php 找到如下代码

if(($validate=='' || $validate != $svali) && preg_match("/6/",$safe_gdopen)){
        ResetVdValue();
        ShowMsg('验证码不正确!','login.php',0,1000);
        exit;
}

第一行替换为   if(false){         

好 问题解决 不输验证码后台直接进去

(学习视频分享:php视频教程

方法二:

打开data/safe/inc.safe.config.php

把代码$safe_gdopen = '1,2,3,4,5,6,7'; 中的6,删除即可

Dede后台验证码不显示情况一分析:

验证码需要GD库 请检查你的环境是否开启GD库 

Dede后台验证码不显示情况二分析:

验证码只显示背景 不显示字母

打开验证码生成文件 Include/vdimgck.php 

找到

for($i=0;$i<$rndcodelen;$i++)
    {
        $bc = mt_rand(0, 1);
        $rndstring[$i] = strtoupper($rndstring[$i]);
        $c_fontColor = $fontColor[mt_rand(0,4)];
        $y_pos = $i==0 ? 4 : $i*($font_size+2);
        $c = mt_rand(0, 15);
        @imagettftext($im, $font_size, $c, $y_pos, 19, $c_fontColor, $font_file, $rndstring[$i]);
        $lastc = $rndstring[$i];
}

Imagettftext()函数没有成功的执行导致了验证码只显示背景,不显示字母

具体原因为 字体文件路径不对.解决方法

1、确认include/data/fonts/ 里面存在字体文件  默认为ggbi.ttf

2、在for($i=0;$i

$font_file= str_replace("\\","/",$font_file);

即把字体文件路径中反斜杠替换成斜杠 因为我们知道反斜杠有转译字符的功能,

$font_file 路经大体为 盘符:\appserv\www 系统错误的把反斜杠 当作转义用了 导致$font_file也就不是一个路径了 所以Imagettftext()函数总是返回错误

加上$font_file= str_replace("\\","/",$font_file);即可解决

Dede后台验证码不显示情况三分析:

Include/data/words/words.txt 文件不存在  

解决方案:

(1)拷贝一个进去

(2)找到代码    'word_type'  => (int)$safe_codetype,   // 1:数字  2:英文   3:单词

(3)换成'word_type'  =>1  (或2) 既验证码为数字或英文

Dede后台验证码不显示 全部情况解决

如果原来可以显示后来取消验证码后再设置就无法显示,可以通过覆盖data与include目录试试。

相关推荐:织梦cms

The above is the detailed content of What should I do if the dedecms background login verification code is not displayed normally?. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:博客园. If there is any infringement, please contact admin@php.cn delete

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools