Home > Article > Backend Development > dedecms collection tutorial dedecms background verification code always prompts the solution to the error
Just 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");
Username does not exist!","");
The password is not empty
ShowMsg( "User and password are not filled in completely!","");
}
//<-Verify user
}
?>
| ||
| ||
|