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 相关文章推荐
使用zend studio for eclipse不能激活代码提示功能的解决办法
Oct 11 PHP
PHP 一个随机字符串生成代码
May 26 PHP
实测在class的function中include的文件中非php的global全局环境
Jul 15 PHP
php中chdir()函数用法实例
Nov 13 PHP
Yii的CDbCriteria查询条件用法实例
Dec 04 PHP
php实现将Session写入数据库
Jul 26 PHP
php实现转换html格式为文本格式的方法
May 16 PHP
php set_include_path函数设置 include_path 配置选项
Oct 30 PHP
使用ucenter实现多站点同步登录的讲解
Mar 21 PHP
PHP析构函数destruct与垃圾回收机制的讲解
Mar 22 PHP
解决PHPstudy Apache无法启动的问题【亲测有效】
Oct 30 PHP
PHP正则表达式之RCEService回溯
Apr 11 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
php5.5中类级别的常量使用介绍
2013/10/02 PHP
php官方微信接口大全(微信支付、微信红包、微信摇一摇、微信小店)
2015/12/21 PHP
PHP计算数组中值的和与乘积的方法(array_sum与array_product函数)
2016/04/01 PHP
Joomla开启SEF的方法
2016/05/04 PHP
浅析PHP 中move_uploaded_file 上传中文文件名失败
2019/04/17 PHP
Javascript 面向对象之重载
2010/05/04 Javascript
jQuery中的height innerHeight outerHeight区别示例介绍
2014/06/15 Javascript
js使用for循环查询数组中是否存在某个值
2014/08/12 Javascript
JQuery EasyUI 加载两次url的原因分析及解决方案
2014/08/18 Javascript
JS实现鼠标箭头变成一个燃烧烛光效果的方法
2015/02/28 Javascript
JavaScritp添加url参数并将参数加入到url中及更改url参数的方法
2015/10/26 Javascript
学习javascript面向对象 理解javascript对象
2016/01/04 Javascript
BootstrapTable与KnockoutJS相结合实现增删改查功能【二】
2016/05/10 Javascript
vue的状态管理模式vuex
2017/11/30 Javascript
详解webpack4升级指南以及从webpack3.x迁移
2018/06/12 Javascript
vue-swiper的使用教程
2018/08/30 Javascript
微信小程序实现点击图片旋转180度并且弹出下拉列表
2018/11/27 Javascript
使用Python编写类UNIX系统的命令行工具的教程
2015/04/15 Python
对Python通过pypyodbc访问Access数据库的方法详解
2018/10/27 Python
python 用for循环实现1~n求和的实例
2019/02/01 Python
python把转列表为集合的方法
2019/06/28 Python
Python 字符串类型列表转换成真正列表类型过程解析
2019/08/26 Python
Python数据存储之 h5py详解
2019/12/26 Python
Python hashlib常见摘要算法详解
2020/01/13 Python
PyCharm配置anaconda环境的步骤详解
2020/07/31 Python
Python函数递归调用实现原理实例解析
2020/08/11 Python
Python爬虫破解登陆哔哩哔哩的方法
2020/11/17 Python
澳大利亚家庭花园和DIY工具网店:VidaXL
2019/05/03 全球购物
草莓网中国:StrawberryNet中国
2020/08/17 全球购物
市三好学生主要事迹
2014/01/28 职场文书
初中同学聚会感言
2014/02/11 职场文书
请假条怎么写
2014/04/10 职场文书
请病假条范文
2015/08/17 职场文书
CSS3 菱形拼图实现只旋转div 背景图片不旋转功能
2021/03/30 HTML / CSS
JVM入门之类加载与字节码技术(类加载与类的加载器)
2021/06/15 Java/Android
详解jQuery的核心函数和事件处理
2022/02/18 jQuery