知识专栏
多方位、多角度、深度解读您所关心的问题

因特殊需求(比如对接采集软件),需要把phpcms v9后台登录的验证码取消掉,那怎么取消掉呢?

操作教程如下:

(1)打开phpcms/modules/admin/index.php,

大概第33-37行,找到以下代码

    $code = isset($_POST['code']) && trim($_POST['code']) ? trim($_POST['code']) : showmessage(L('input_code'), HTTP_REFERER);
    if ($_SESSION['code'] != strtolower($code)) {
     $_SESSION['code'] = '';
     showmessage(L('code_error'), HTTP_REFERER);
    }

将其注释掉或者删掉。

(2)打开phpcms/modules/admin/templates/login.tpl.php

大概第33-42行,找到以下代码

            <li class="windx">
                <div class="lita a2">验证码</div>
                <div style="position:absolute; z-index:2; right:7px; margin-top: 5px;">
                    <a href="javascript:document.getElementById('code_img').src='<?php echo SITE_PROTOCOL.SITE_URL.WEB_PATH;?>api.php?op=checkcode&m=admin&c=index&a=checkcode&time='+Math.random();void(0);" title="点击更换验证码"><?php echo form::checkcode('code_img')?></a>
                </div>
                <div class="rita">
                    <input type="text" class="xux" name="code" />
                    <div class="at info"></div>
                </div>
            </li>

将其注释掉或者删掉。

(3)刷新网站后台,就看不到验证码了。现在只需要输入用户名和密码,就可以正常登录后台了,也不会提示验证码错误。


猜您还想看: php cms 后台 验证码 登录
赞一下
--
踩一脚
--
扩展阅读

您已成功复制微信号

leishi010

打开微信添加好友?

确定