Use the following code directly to cover the login.php in Dede
Copy Code code as follows:
?
Require_once (DirName (__file__). " /.. /include/config_base.php ");
Require_once (DirName (__file__). " /.. /include/inc_userlogin.php ");
if (empty ($dopost)) $dopost = "";
//--------------------------------
Login detection
//--------------------------------
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);
Successful Login
if ($res ==1) {
$cuserLogin->keepuser ();
if (!empty ($gotopage)) {
Header ("Location: $gotopage");
ShowMsg ("Successfully logged in, is moving to the admin admin home page!") ", $gotopage);
Exit ();
}
else{
ShowMsg ("Successfully logged in, is moving to the admin admin home page!") "," index.php ");
Header ("location:index.php");
Exit ();
}
}
else if ($res ==-1) {
ShowMsg ("Your username does not exist!", "");
}
else{
ShowMsg ("Your password is wrong!", "");
}
}//<-Password is not empty
else{
ShowMsg ("User and password not complete!", "");
}
<-Authentication User
}
?>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<title> Management System </title>
<link href= "Base.css" rel= "stylesheet" type= "Text/css" >
<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= "background=" img/indextitlebg.gif ></td>
</tr>
<tr>
<TD width= "100%" height= "> </td>
</tr>
<tr>
<TD width= "100%" height= "valign=" "Bottom" >
<table width= "540" border= "0" cellspacing= "0" cellpadding= "0" >
<tr>
<TD align= "Right" style= "font-size:2pt" > </td>
</tr>
<tr>
<td> User login </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 ($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= "align=" "Center" > Username:</td>
<TD width= "384" > <input type= "text" name= "userid" style= "width:150;height:20" >
</td>
</tr>
<tr>
<TD height= align= "center" > Password: </td>
<td> <input type= "password" name= "pwd" style= "width:150;height:20" >
</td>
</tr>
<tr>
<TD height= "colspan=" 2 "align=" center "> <input type=" button "Name=" SM1 "value=" Login "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.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>