dedecms后臺(tái)驗(yàn)證碼總提示錯(cuò)誤的解決方法
更新時(shí)間:2007年03月21日 00:00:00 作者:
直接用下面的代碼,覆蓋dede中的login.php即可
<?
require_once(dirname(__FILE__)."/../include/config_base.php");
require_once(dirname(__FILE__)."/../include/inc_userlogin.php");
if(empty($dopost)) $dopost="";
//--------------------------------
//登錄檢測(cè)
//--------------------------------
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("成功登錄,正在轉(zhuǎn)向管理管理主頁(yè)!",$gotopage);
exit();
}
else{
ShowMsg("成功登錄,正在轉(zhuǎn)向管理管理主頁(yè)!","index.php");
//header("location:index.php");
exit();
}
}
else if($res==-1){
ShowMsg("你的用戶名不存在!","");
}
else{
ShowMsg("你的密碼錯(cuò)誤!","");
}
}//<-密碼不為空
else{
ShowMsg("用戶和密碼沒填寫完整!","");
}
//<-驗(yàn)證用戶
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>管理系統(tǒng)</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('http://www.dbjr.com.cn');" 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>
復(fù)制代碼 代碼如下:
<?
require_once(dirname(__FILE__)."/../include/config_base.php");
require_once(dirname(__FILE__)."/../include/inc_userlogin.php");
if(empty($dopost)) $dopost="";
//--------------------------------
//登錄檢測(cè)
//--------------------------------
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("成功登錄,正在轉(zhuǎn)向管理管理主頁(yè)!",$gotopage);
exit();
}
else{
ShowMsg("成功登錄,正在轉(zhuǎn)向管理管理主頁(yè)!","index.php");
//header("location:index.php");
exit();
}
}
else if($res==-1){
ShowMsg("你的用戶名不存在!","");
}
else{
ShowMsg("你的密碼錯(cuò)誤!","");
}
}//<-密碼不為空
else{
ShowMsg("用戶和密碼沒填寫完整!","");
}
//<-驗(yàn)證用戶
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>管理系統(tǒng)</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('http://www.dbjr.com.cn');" 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>
相關(guān)文章
Centos 6.5下PHP 5.3安裝ffmpeg擴(kuò)展的步驟詳解
大家都知道ffmpeg是一款視頻流的軟件了,我們?cè)趌inux系統(tǒng)中可以安裝ffmpeg了,這篇文章主要介紹了在Centos 6.5下PHP 5.3安裝ffmpeg擴(kuò)展的步驟,需要的朋友可以參考下。2017-03-03php實(shí)現(xiàn)復(fù)制移動(dòng)文件的方法
這篇文章主要介紹了php實(shí)現(xiàn)復(fù)制移動(dòng)文件的方法,實(shí)例分析了php實(shí)現(xiàn)針對(duì)文件的復(fù)制及移動(dòng)的技巧,需要的朋友可以參考下2015-07-07php在多維數(shù)組中根據(jù)鍵名快速查詢其父鍵以及父鍵值的代碼
有一個(gè)多維數(shù)組,有多少維大家可以自定義。假如我們要在這個(gè)數(shù)組中找一個(gè)鍵為'subIndex'的值,我們可以用for、foreach等方法遍歷查找 反過(guò)來(lái),假如我們?nèi)我饨o出一個(gè)或多個(gè)鍵,要求找出這個(gè)鍵的父級(jí)數(shù)組的鍵和值。這又如何實(shí)現(xiàn)?2011-05-05PHP實(shí)現(xiàn)簡(jiǎn)單的協(xié)程任務(wù)調(diào)度demo示例
這篇文章主要介紹了PHP實(shí)現(xiàn)簡(jiǎn)單的協(xié)程任務(wù)調(diào)度demo,結(jié)合實(shí)例形式詳細(xì)分析了PHP基于協(xié)程的任務(wù)調(diào)度基本原理、定義及使用技巧,需要的朋友可以參考下2020-02-02Json_decode 解析json字符串為NULL的解決方法(必看)
下面小編就為大家?guī)?lái)一篇Json_decode 解析json字符串為NULL的解決方法(必看)。小編覺得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2017-02-02