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 06 PHP
PHP Mysql编程之高级技巧
Aug 27 PHP
php实现的click captcha点击验证码类实例
Sep 23 PHP
PHP编程之设置apache虚拟目录
Jul 08 PHP
php实现的中文分词类完整实例
Feb 06 PHP
替换php字符串中的单引号为双引号的方法
Feb 16 PHP
PHP策略模式定义与用法示例
Jul 27 PHP
PHP基于关联数组20行代码搞定约瑟夫问题示例
Nov 07 PHP
PHP Class SoapClient not found解决方法
Jan 20 PHP
详解PHP版本兼容之openssl调用参数
Jul 25 PHP
php微信公众号开发之图片回复
Oct 20 PHP
PHP基于GD2函数库实现验证码功能示例
Jan 27 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
用PHP连mysql和oracle数据库性能比较
2006/10/09 PHP
PHP设计模式之命令模式的深入解析
2013/06/13 PHP
CodeIgniter钩子用法实例详解
2016/01/20 PHP
掌握PHP垃圾回收机制详解
2019/03/13 PHP
JavaScript 无符号右移运算符
2009/04/17 Javascript
使用jquery读取html5 localstorage的值的方法
2013/01/04 Javascript
5分钟理解JavaScript中this用法分享
2013/11/09 Javascript
教你在heroku云平台上部署Node.js应用
2014/07/30 Javascript
JavaScript数组常用操作技巧汇总
2014/11/17 Javascript
js实现鼠标触发图片抖动效果的方法
2015/02/27 Javascript
JavaScript判断表单中多选框checkbox选中个数的方法
2015/08/17 Javascript
js贪吃蛇网页版游戏特效代码分享(挑战十关)
2015/08/24 Javascript
JavaScript操作URL的相关内容集锦
2015/10/29 Javascript
JavaScript实现页面无操作倒计时退出
2016/10/22 Javascript
jQuery网页定位导航特效实现方法
2016/12/19 Javascript
js实现textarea限制输入字数
2017/02/13 Javascript
JQuery实现文字无缝滚动效果示例代码(Marquee插件)
2017/03/07 Javascript
AngularJS的脏检查深入分析
2017/04/22 Javascript
vue2.0在没有dev-server.js下的本地数据配置方法
2018/02/23 Javascript
angularjs 缓存的使用详解
2018/03/19 Javascript
详解使用mpvue开发github小程序总结
2018/07/25 Javascript
详解超简单的react服务器渲染(ssr)入坑指南
2019/02/28 Javascript
python将MongoDB里的ObjectId转换为时间戳的方法
2015/03/13 Python
Python实现多线程抓取网页功能实例详解
2017/06/08 Python
python3.4下django集成使用xadmin后台的方法
2017/08/15 Python
Python爬虫实现“盗取”微信好友信息的方法分析
2019/09/16 Python
HTML5中使用json对象的实例代码
2018/09/10 HTML / CSS
MUGLER官方网站:蒂埃里·穆勒香水
2019/11/26 全球购物
兰蔻法国官方网站:Lancôme法国
2020/02/22 全球购物
MIS软件工程师的面试题
2016/04/22 面试题
婚庆公司的创业计划书
2014/01/22 职场文书
互联网电子商务专业毕业生求职信
2014/03/18 职场文书
党支部综合考察材料
2014/05/19 职场文书
敬老月活动总结
2014/08/28 职场文书
2014年“世界无车日”活动方案
2014/09/21 职场文书
2019毕业典礼主持词!
2019/07/05 职场文书