武汉SEO
时光静好,与君语;细水流年,与君同;繁华落尽,与君老...

网站使用技巧>正文

骑士cms忘记了密码咋办啊

2014-03-31 22:28
骑士cms忘记了密码咋办啊。不用着急,
复制以下代码:
 
<?php
 
define(’IN_QISHI’, true);
require_once(dirname(__FILE__).’/include/common.inc.php’);
require_once(QISHI_ROOT_PATH.’include/mysql.class.php’);
$db = new mysql($dbhost,$dbuser,$dbpass,$dbname);
$act = !empty($_GET[’act’]) ? trim($_GET[’act’]) : ’set’;
?>
<!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=gb2312" />
<title>骑士人才系统后台用户名密码重设工具</title>
<style type="text/css">
<!--
body {
 margin-left: 0px;
 margin-top: 50px;
 margin-right: 0px;
 margin-bottom: 0px;
 background-color: #F4F7F9;
 line-height:180%
}
body,td,th {
 font-size: 12px;
 color: #000000;
}
form{ padding:0px; margin:0px;}
a:link {
 color: #0066CC;
}
a:visited {
 color: #0066CC;
}
a:hover {
 color: #009900;
}
-->
</style></head>
<body>
<?php
if ($act=="set")
{
?>
  <table width="500" border="0" align="center" cellpadding="5" cellspacing="0">
    <tr>
      <td align="center"><strong  style="font-size:14px;">骑士人才系统后台用户名密码重设工具</strong></td>
    </tr>
    <tr>
      <td>
   <strong>说明:</strong>此工具仅适用于骑士人才系统3.0及以上版本,由<a href="http://www.jiuquan.cc/" target="_blank">骑士人才系统官方站</a>提供,如遇问题请到<a href="http://www.jiuquan.cc/bbs/" target="_blank">论坛</a>求助。<br />
请在下方表单中输入您要重设的用户名和密码,重设后请务必删除文件。</td>
    </tr>
  </table>
<form id="form1" name="form1" method="post" action="?act=save">
  <table width="500" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#B6D1EB">
    <tr>
      <td bgcolor="#DFF3FD">&nbsp;&nbsp;请填写您要重设的用户名和密码:</td>
    </tr>
    <tr>
      <td height="150" bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="5">
          <tr>
            <td width="100" align="right">设置用户名:</td>
            <td><input name="adminname" type="text" size="20" /></td>
          </tr>
          <tr>
            <td align="right">设置新密码:</td>
            <td><input name="adminpwd" type="text"  size="20" /></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td><input type="submit" name="Submit" value="保存"  style="font-size:12px; padding:3px;" /></td>
          </tr>
      </table></td>
    </tr>
  </table>
</form>
<?php
}
elseif ($act=="save")
{
 $account = $db->getone("SELECT * FROM ".table(’admin’)." WHERE admin_id = ’1’");
 if (empty($account))
 {
 exit("后台管理员帐号不存在!");
 }
 if (strlen(trim($_POST[’adminpwd’]))<5) exit("<script language=javascript>alert(’密码长度不能小于6个字符!’);window.location=’?act=’</script>");
 if (strlen(trim($_POST[’adminname’]))<2) exit("<script language=javascript>alert(’用户名长度不能小于2个字符!’);window.location=’?act=’</script>");
    $setsqlarr[’admin_name’]=trim($_POST[’adminname’]);
    $setsqlarr[’pwd’]=md5($_POST[’adminpwd’].$account[’pwd_hash’].$QS_pwdhash);
    if (!updatetable(table(’admin’),$setsqlarr," admin_id=’1’"))
    {
    exit("密码重设失败!");
    }
?>
<table width="500" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#FBD08A">
    <tr>
      <td align="center" bgcolor="#FFFDF0"  style="color:#FF0000">
   恭喜您设置成功,请务必删本工具!   </td>
    </tr>
</table>
<?php
}
?>
</body>
</html>
保存为editaccount.php。域名加上这个就可以了

本文链接:https://www.0937.biz/post-123.html