dedecms后台验证码总提示错误的解决方法


Posted in PHP onMarch 21, 2007

直接用下面的代码,覆盖dede中的login.php即可

<? 
require_once(dirname(__FILE__)."/../include/config_base.php"); 
require_once(dirname(__FILE__)."/../include/inc_userlogin.php"); 
if(empty($dopost)) $dopost=""; 
//-------------------------------- 
//登录检测 
//-------------------------------- 
if($dopost=="login") 
{ 
  if(empty($validate)) $validate==""; 
  else $validate = strtolower($validate);   if( empty($_SESSION["s_validate"]) ) $svali = ""; 
  else $svali = $_SESSION["s_validate"]; 
   $cuserLogin = new userLogin(); 
     if(!empty($userid)&&!empty($pwd)) 
     { 
              $res = $cuserLogin->checkUser($userid,$pwd); 
              //成功登录 
              if($res==1){ 
                       $cuserLogin->keepUser(); 
                       if(!empty($gotopage)){ 
                               //header("location:$gotopage"); 
                               ShowMsg("成功登录,正在转向管理管理主页!",$gotopage); 
                               exit(); 
                       } 
                       else{ 
                               ShowMsg("成功登录,正在转向管理管理主页!","index.php"); 
                               //header("location:index.php"); 
                               exit(); 
                       } 
              } 
              else if($res==-1){ 
                      ShowMsg("你的用户名不存在!",""); 
              } 
              else{ 
                      ShowMsg("你的密码错误!",""); 
              } 
     }//<-密码不为空 
     else{ 
            ShowMsg("用户和密码没填写完整!",""); 
     } 
//<-验证用户 
} 
?> 
<html> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"> 
<title>管理系统</title> 
<link href="base.css" rel="stylesheet" type="text/css"> 
</head> 
<body style='MARGIN: 0px' bgColor='#ffffff' leftMargin='0' topMargin='0' scroll='no'> 
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#111111" style="BORDER-COLLAPSE: collapse"> 
  <tr>  
    <td width="100%" height="64" background="img/indextitlebg.gif"><img src="img/indextitle.gif" width="250" height="64">  
    </td> 
  </tr> 
  <tr>  
    <td width="100%" height="20"> </td> 
  </tr> 
  <tr>  
    <td width="100%" height="20" valign="bottom"> 
        <table width="540" border="0" cellspacing="0" cellpadding="0"> 
        <tr>  
          <td align="right" style="FONT-SIZE: 2pt"> </td> 
        </tr> 
        <tr>  
          <td><IMG height=14 src="img/book1.gif" width=20>  用户登录</td> 
        </tr> 
      </table></td> 
  </tr> 
  <tr>  
    <td width="100%" height="1" background="img/sp_bg.gif"></td> 
  </tr> 
  <tr>  
    <td width="100%" height="2"></td> 
  </tr> 
  <tr>  
    <td width="100%" height="136" valign="top"> 
        <form name="form1" method="post" action="login.php"> 
        <input type="hidden" name="gotopage" value="<?if(!empty($gotopage)) echo $gotopage;?>"> 
        <input type="hidden" name="dopost" value="login"> 
        <table width="540" border="0" cellspacing="0" cellpadding="0"> 
          <tr>  
            <td colspan="2" height="4"></td> 
          </tr> 
          <tr>  
            <td width="156" height="30" align="center"> 用户名:</td> 
            <td width="384"> <input type="text" name="userid" style="width:150;height:20">  
            </td> 
          </tr> 
          <tr>  
            <td height="30" align="center"> 密 码: </td> 
            <td> <input type="password" name="pwd" style="width:150;height:20">  
            </td> 
          </tr> 
          <tr>  
            <td height="50" colspan="2" align="center"> <input type="button" name="sm1" value="登录" style="background-color:#BAE171;border:1px solid #666666" onClick="this.form.submit();">  
                <input type="button" name="sm2" value="Power by DedeCms" onClick="window.open('https://3water.com');" style="background-color:#FFFFFF;border:1px solid #DDDDDD;color:#DDDDDD">  
                </td> 
          </tr> 
        </table> 
      </form></td> 
  </tr> 
  <tr>  
    <td width="100%" height="2" valign="top"></td> 
  </tr> 
</table> 
</body> 
</html>
PHP 相关文章推荐
php 设计模式之 工厂模式
Dec 19 PHP
php SQL Injection with MySQL
Feb 27 PHP
php array_push()数组函数:将一个或多个单元压入数组的末尾(入栈)
Jul 12 PHP
WordPress主题制作中自定义头部的相关PHP函数解析
Jan 08 PHP
CI(CodeIgniter)模型用法实例分析
Jan 20 PHP
详解PHP实现异步调用的4种方法
Mar 14 PHP
PHPStorm+XDebug进行调试图文教程
Jun 13 PHP
CodeIgniter框架验证码类库文件与用法示例
Mar 18 PHP
PHP基于GD库实现的生成图片缩略图函数示例
Jul 05 PHP
三个思路解决laravel上传文件报错:413 Request Entity Too Large问题
Nov 13 PHP
360搜索引擎自动收录php改写方案
Apr 28 PHP
ThinkPHP5分页paginate代码实例解析
Nov 10 PHP
dedecms中显示数字验证码的修改方法
Mar 21 #PHP
PHP的分页功能
Mar 21 #PHP
完美解决dedecms中的[html][/html]和[code][/code]问题
Mar 20 #PHP
自动生成文章摘要的代码[PHP 版本]
Mar 20 #PHP
关于BIG5-HKSCS的解决方法
Mar 20 #PHP
php中支持多种编码的中文字符串截取函数!
Mar 20 #PHP
理解PHP5中static和const关键字的区别
Mar 19 #PHP
You might like
smarty实例教程
2006/11/19 PHP
php读取txt文件组成SQL并插入数据库的代码(原创自Zjmainstay)
2012/07/31 PHP
手把手编写PHP框架 深入了解MVC运行流程
2016/09/19 PHP
微信公众号开发之获取位置信息php代码
2018/06/13 PHP
php和js实现根据子网掩码和ip计算子网功能示例
2019/11/09 PHP
filemanage功能中用到的common.js
2007/04/08 Javascript
javascript FormatNumber函数实现方法
2008/12/30 Javascript
关于javascript function对象那些迷惑分析
2011/10/24 Javascript
使用JavaScript获取电池状态的方法
2014/05/03 Javascript
url传递的参数值中包含&amp;时,url自动截断问题的解决方法
2016/08/02 Javascript
js 去掉字符串前后空格实现代码集合
2017/03/25 Javascript
JS实现区分中英文并统计字符个数的方法示例
2018/06/09 Javascript
深入理解Vue 组件之间传值
2018/08/16 Javascript
[02:38]2018DOTA2亚洲邀请赛赛前采访-VGJ.T
2018/04/03 DOTA
[48:32]VGJ.T vs Fnatic 2018国际邀请赛小组赛BO2 第一场 8.16
2018/08/17 DOTA
[38:39]KG vs Mineski 2019国际邀请赛小组赛 BO2 第一场 8.15
2019/08/16 DOTA
python实现目录树生成示例
2014/03/28 Python
Flask入门教程实例:搭建一个静态博客
2015/03/27 Python
Python迭代器与生成器用法实例分析
2018/07/09 Python
解决webdriver.Chrome()报错:Message:'chromedriver' executable needs to be in Path
2019/06/12 Python
Python使用Opencv实现图像特征检测与匹配的方法
2019/10/30 Python
利用Pytorch实现简单的线性回归算法
2020/01/15 Python
Python使用monkey.patch_all()解决协程阻塞问题
2020/04/15 Python
idealfit英国:世界领先的女性健身用品和运动衣物品牌
2017/11/25 全球购物
临床医学专业个人的自我评价
2013/09/27 职场文书
重阳节登山活动方案
2014/02/03 职场文书
超市开业庆典策划方案
2014/05/14 职场文书
五四青年节优秀演讲稿范文
2014/05/28 职场文书
初级党校心得体会
2014/09/11 职场文书
邀请函模板
2015/02/02 职场文书
房地产公司工程部经理岗位职责
2015/04/09 职场文书
活动总结书怎么写
2015/05/11 职场文书
2015年教师国培感言
2015/08/01 职场文书
Nginx配置80端口访问8080及项目名地址方法解析
2021/03/31 Servers
如何理解及使用Python闭包
2021/06/01 Python
python 镜像环境搭建总结
2022/09/23 Python