DEDECMS Background Verification Code total hint error solution _php tips

Source: Internet
Author: User
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>
&LT;TD width= "100%" height= "background=" img/indextitlebg.gif ></td>
</tr>
<tr>
&LT;TD width= "100%" height= "> </td>
</tr>
<tr>
&LT;TD width= "100%" height= "valign=" "Bottom" >
<table width= "540" border= "0" cellspacing= "0" cellpadding= "0" >
<tr>
&LT;TD align= "Right" style= "font-size:2pt" > </td>
</tr>
<tr>
<td> User login </td>
</tr>
</table></td>
</tr>
<tr>
&LT;TD width= "100%" height= "1" background= "Img/sp_bg.gif" ></td>
</tr>
<tr>
&LT;TD width= "100%" height= "2" ></td>
</tr>
<tr>
&LT;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>
&LT;TD colspan= "2" height= "4" ></td>
</tr>
<tr>
&LT;TD width= "156" height= "align=" "Center" > Username:</td>
&LT;TD width= "384" > <input type= "text" name= "userid" style= "width:150;height:20" >
</td>
</tr>
<tr>
&LT;TD height= align= "center" > Password: </td>
<td> <input type= "password" name= "pwd" style= "width:150;height:20" >
</td>
</tr>

<tr>
&LT;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>
&LT;TD width= "100%" height= "2" valign= "Top" ></td>
</tr>
</table>
</body>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.