由于很多站长有多个网站,一段时间不登录后台就忘记了后台的管理密码,这里有一个重设置多多淘客程序的代码,将下面的程序保存为一文件pass.php,你可以改成其它名字,但必须和代码里的提交文件一致才行。代码如下:
[cc lang=”php”]
<?php
include_once ‘comm/conn.php’;
$username=$_POST[‘username’];
$pwd=md5($_POST[‘pwd’]);
if($username!=”){
$link = mysql_connect($dbserver, $dbuser, $dbpass);
if (!$link) {
die(‘connect to database failed! ‘ . mysql_error());
}
else
{
mysql_query(“set names utf8”);
$sql=”update “.$BIAOTOU.”duoduo2010 set adminname='”.$username.”‘,adminpass='”.$pwd.”‘”;
mysql_select_db($dbname);
mysql_query($sql);
echo “<meta http-equiv=\”Content-Type\” content=\”text/html; charset=utf-8\” />提示:用户名和密码修改成功!<br>新的用户名:<span style=\”color:#FF0000; font-size:14px; font-weight:bold\”>”.$_POST[‘username’].”</span><br>新的密码是:<span style=\”color:#FF0000; font-size:14px; font-weight:bold\”>”.$_POST[‘pwd’].”</span><br>如系统没有自动删除请及时删除这个文件!<br><a href=\”admin/login.php\”>进入后台!
</a>”;
unlink(‘pass.php’);
exit;
}
mysql_close($link);
}
?>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd“>
<html xmlns=”http://www.w3.org/1999/xhtml“>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />
<title>密码重设工具_多多淘宝客</title>
<script language=”javascript” type=”text/javascript”>
function checkall()
{
if(document.getElementById(“username”).value==””||document.getElementById(“pwd”).value==””)
{
alert(‘请填写新的用户名和密码!’);
return false;
}
else
{
return true;
}
}
</script>
<style type=”text/css”>
<!–
body {
font-family: “MS Serif”, “New York”, serif;
font-size: 12px;
color: #000;
}
table {
border-top-width: 1px;
border-right-width: 1px;
border-left-width: 1px;
border-top-style: dotted;
border-right-style: dotted;
border-left-style: dotted;
border-top-color: #CCC;
border-right-color: #CCC;
border-left-color: #CCC;
}
td {
border-bottom-width: 1px;
border-bottom-style: dotted;
border-bottom-color: #CCC;
}
–>
</style>
</head>
<body>
<table width=”98%” border=”0″ align=”center” cellpadding=”3″ cellspacing=”1″>
<tr>
<td height=”19″ bgcolor=”#E7E7E7″><table width=”96%” border=”0″ cellspacing=”1″ cellpadding=”1″>
<tr>
<td><div align=”center”><b><strong style=”font-size:14px”>多多淘宝客后台管理员密码重置</strong></b></div></td>
</tr>
</table></td>
</tr>
<tr>
<td height=”215″ align=”center” valign=”top” bgcolor=”#FFFFFF”><form action=”radminpass.php” method=”post” name=”form1″ id=”form1″ onsubmit=”return checkall()”>
<table width=”98%” border=”0″ cellspacing=”1″ cellpadding=”1″>
<tr>
<td height=”43″ colspan=”2″ align=”left”><div align=”left” style=”font-size:14px; line-height:20PX; padding:10px;”> 本工具是用于新人忘记管理员密码重设所制作,只需要将radminpass.php文件拷贝到根目录,运行“http://yousite/radminpass.php(yousite为网站域名)”,按照操作执行就可以。<font color=”#FF0000″>修改完成后如系统没有自动删除请及时删除这个文件!</font></div></td>
</tr>
<tr>
<td width=”16%” height=”30″ align=”left”><div align=”right”>管理员账号:</div></td>
<td width=”84%” align=”left”><input name=”username” type=”text” id=”username” size=”16″ style=”width:200px” />
(3-20位,后台可更改) </td>
</tr>
<tr>
<td height=”30″ align=”left”><div align=”right”>管理员密码:</div></td>
<td align=”left”><input name=”pwd” type=”text” id=”pwd” size=”16″ style=”width:200px” />
(6-20位,只能用‘0-9a-zA-Z.@_-!’以内范围的字符) </td>
</tr>
<tr>
<td height=”60″ align=”left”> </td>
<td align=”left”><input type=”submit” name=”Submit” value=”确定修改 ” /></td>
</tr>
</table>
</form></td>
</tr>
</table>
</body>
</html>
[/cc]
将文件copy到站点的根目录下,运行htpp://www.xxxx.com/pass.php
