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 相关文章推荐
关于PHP5 Session生命周期介绍
Mar 02 PHP
php函数间的参数传递(值传递/引用传递)
Sep 23 PHP
ThinkPHP3.1新特性之Action参数绑定
Jun 19 PHP
PHP实现把文本中的URL转换为链接的auolink()函数分享
Jul 29 PHP
递归实现php数组转xml的代码分享
May 14 PHP
ThinkPHP3.2.1图片验证码实现方法
Aug 19 PHP
PHP7安装Redis扩展教程【Linux与Windows平台】
Sep 30 PHP
PHP中字符与字节的区别及字符串与字节转换示例
Oct 15 PHP
PHP unlink与rmdir删除目录及目录下所有文件实例代码
Feb 07 PHP
PHP实现微信提现(企业付款到零钱)
Aug 01 PHP
Yii框架分页技术实例分析
Aug 30 PHP
PHP7.3.10编译安装教程
Oct 08 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强制下载PDF文件示例
2014/01/17 PHP
destoon供应信息title调用出公司名称的方法
2014/08/22 PHP
非常实用的php验证码类
2016/05/15 PHP
PHP从零开始打造自己的MVC框架之路由类实现方法分析
2019/06/03 PHP
javascript实现划词标记+划词搜索功能
2007/03/06 Javascript
jquery ajax提交表单数据的两种实现方法
2010/04/29 Javascript
javascript中substr,substring,slice.splice的区别说明
2010/11/25 Javascript
jQuery插件开发基础简单介绍
2013/01/07 Javascript
禁止拷贝网页内容的js代码
2014/01/22 Javascript
js判断是否为空和typeof的用法(详解)
2016/10/07 Javascript
Node.js Sequelize如何实现数据库的读写分离
2016/10/23 Javascript
详解使用路由延迟加载 Angular 模块
2017/10/12 Javascript
vue将时间戳转换成自定义时间格式的方法
2018/03/02 Javascript
js调用设备摄像头的方法
2018/07/19 Javascript
ES6中let、const的区别及变量的解构赋值操作方法实例分析
2019/10/15 Javascript
详解JavaScript的this指向和绑定
2020/09/08 Javascript
python2.7删除文件夹和删除文件代码实例
2013/12/18 Python
python使用内存zipfile对象在内存中打包文件示例
2014/04/30 Python
Python利用Nagios增加微信报警通知的功能
2016/02/18 Python
python数据类型_字符串常用操作(详解)
2017/05/30 Python
python使用jieba实现中文分词去停用词方法示例
2018/03/11 Python
Python操作mongodb数据库进行模糊查询操作示例
2018/06/09 Python
python实现自动网页截图并裁剪图片
2018/07/30 Python
Python 从一个文件中调用另一个文件的类方法
2019/01/10 Python
tensorflow实现打印ckpt模型保存下的变量名称及变量值
2020/01/04 Python
Python函数式编程实例详解
2020/01/17 Python
Python 实现网课实时监控自动签到、打卡功能
2020/03/12 Python
关于老式浏览器兼容HTML5和CSS3的问题
2016/06/01 HTML / CSS
单位法定代表人授权委托书
2014/09/20 职场文书
代办出身证明书
2014/10/21 职场文书
违纪学生保证书
2015/02/27 职场文书
小学教师师德师风自我评价
2015/03/04 职场文书
奠基仪式致辞
2015/07/30 职场文书
2016年小学生新年寄语
2015/08/18 职场文书
导游词之千岛湖
2019/09/23 职场文书
tensorflow学习笔记之tfrecord文件的生成与读取
2021/03/31 Python