Home  >  Article  >  Backend Development  >  Solution to the problem that dedecms background verification code always prompts errors_PHP tutorial

Solution to the problem that dedecms background verification code always prompts errors_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 15:55:41917browse

Directly use the following code to overwrite login.php in dede

Copy the code The code is as follows:

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");
                                                                                                                                                                                                                                                                                                                                                  -1){
                   ShowMsg("Your username does not exist!"                                                                                      ShowMsg("Your password is wrong!","");
                                                                                                                                                                                                 //<-Verify user
}

?>



管理系统




   
    
  
   
    
  
   
    
  
   
    
  
   
    
  
   
    
  
   
    
  

 
    
 

        
         
          
        
         
          
        
      
 
  用户登录

        

        
        
        
           
            
          
           
            
            
          
           
            
            
          

           
              
                 
                
          

        
 用户名:   
            
 密 码:    
            

      




www.bkjia.comtruehttp://www.bkjia.com/PHPjc/318265.htmlTechArticle直接用下面的代码,覆盖dede中的login.php即可 复制代码 代码如下: ? require_once(dirname(__FILE__)."/../include/config_base.php"); require_once(dirname(__FILE__)."...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn