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中str_replace函数使用小结
Oct 11 PHP
php导出word文档与excel电子表格的简单示例代码
Mar 08 PHP
php使用$_POST或$_SESSION[]向js函数传参
Sep 16 PHP
PHP中执行cmd命令的方法
Oct 11 PHP
PHP使用glob函数遍历目录或文件夹的方法
Dec 16 PHP
PHP学习笔记(二):变量详解
Apr 17 PHP
php简单判断两个字符串是否相等的方法
Jul 13 PHP
简单谈谈PHP vs Node.js
Jul 17 PHP
PHP支付系统设计与典型案例分享
Aug 02 PHP
PHP截取发动短信内容的方法
Jul 04 PHP
PHP异常处理定义与使用方法分析
Jul 25 PHP
PHP实现求两个字符串最长公共子串的方法示例
Nov 17 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
DOTA2 1月28日更新:监管系统降临刀塔世界
2021/01/28 DOTA
php基于curl扩展制作跨平台的restfule 接口
2015/05/11 PHP
thinkphp3.2中Lite文件替换框架入口文件或应用入口文件的方法
2015/05/21 PHP
PHP实现的简单异常处理类示例
2017/05/04 PHP
Laravel访问出错提示:`Warning: require(/vendor/autoload.php): failed to open stream: No such file or di解决方法
2019/04/02 PHP
Laravel 修改验证异常的响应格式实例代码详解
2020/05/25 PHP
Javascript中的isNaN函数使用说明
2011/11/10 Javascript
jquery实现在页面加载的时自动为日期插件添加当前日期
2014/08/20 Javascript
JavaScript 事件对象介绍
2015/04/13 Javascript
实现高性能JavaScript之执行与加载
2016/01/30 Javascript
使用jQuery判断浏览器滚动条位置的方法
2016/05/30 Javascript
Node.js环境下编写爬虫爬取维基百科内容的实例分享
2016/06/12 Javascript
移动端H5开发 Turn.js实现很棒的翻书效果
2016/06/20 Javascript
详解如何用babel转换es6的class语法
2018/04/03 Javascript
vue 路由嵌套高亮问题的解决方法
2018/05/17 Javascript
基于ssm框架实现layui分页效果
2019/07/27 Javascript
vue 对axios get pust put delete封装的实例代码
2020/01/05 Javascript
小程序开发之模态框组件封装
2020/04/23 Javascript
Vue数组响应式操作及高阶函数使用代码详解
2020/08/01 Javascript
[01:08:30]DOTA2-DPC中国联赛 正赛 Ehome vs Elephant BO3 第一场 2月28日
2021/03/11 DOTA
python list删除元素时要注意的坑点分享
2018/04/18 Python
python学习--使用QQ邮箱发送邮件代码实例
2019/04/16 Python
Jupyter notebook无法导入第三方模块的解决方式
2020/04/15 Python
Pycharm Git 设置方法
2020/09/15 Python
CSS3属性使网站设计增强同时不消弱可用性
2009/08/29 HTML / CSS
英国领先的电子、技术和办公用品购物网站:Ebuyer
2018/04/04 全球购物
美国在线购物频道:Shop LC
2019/04/21 全球购物
团员个人的自我评价
2013/12/02 职场文书
企业车辆管理制度
2014/01/24 职场文书
应聘文员自荐信范文
2014/03/11 职场文书
我的梦想演讲稿1000字
2014/08/21 职场文书
出差报告格式模板
2014/11/06 职场文书
2014年督导工作总结
2014/11/19 职场文书
2016年领导干部正风肃纪心得体会
2015/10/09 职场文书
python可视化之颜色映射详解
2021/09/15 Python
Win2008系统搭建DHCP服务器
2022/06/25 Servers