dedecms后台验证码总提示错误的解决方法
程序员文章站
2022-04-08 23:35:12
直接用下面的代码,覆盖dede中的login.php即可复制代码 代码如下: require_once(dirname(__file__)."/../includ...
直接用下面的代码,覆盖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('//www.jb51.net');" 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>
复制代码 代码如下:
<?
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('//www.jb51.net');" 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>
下一篇: 读取数据,并以txt格式保存
推荐阅读
-
360浏览器输入验证码一直提示错误的三种解决方法
-
dedecms后台验证码总提示错误的解决方法
-
360浏览器输入验证码一直提示错误的三种解决方法
-
验证码总是错误怎么办? 输入验证码总是提示错误的解决方法汇总
-
详解DedeCMS不支持PHP5.3、5.4及以上版本后台500错误白屏的解决方法
-
dedecms采集教程 dedecms后台验证码总提示错误的解决方法
-
dedecms后台验证码总提示错误的解决方法
-
dedecms采集教程 dedecms后台验证码总提示错误的解决方法
-
3种可能原因导致织梦DEDECMS后台验证码错误不能正常验证的解决方法
-
3种可能原因导致织梦DEDECMS后台验证码错误不能正常验证的解决方法