⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin_mp.php

📁 我们运用一个小的记事本
💻 PHP
字号:
<?php
include 'check.php';
include 'include/config.php';
include 'include/para.php';
$page=$_GET['page'];
if (empty($page)) $page=1;
$pageUrl=$_SERVER['PHP_SELF'];
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>修改管理密码 - <?php echo $gb_name?></title>
<link href="include/css.css" rel="stylesheet" type="text/css">
</head>
<body>
<?php include 'include/head.php';?>
<?php 
if(empty($_POST['ac'])){?>
<form name="form1" method="post" action="<?php $_SERVER['PHP_SELF']?>" onsubmit="return FrontPage_Form1_Validator(this)">
  <table width="750" border="0" align="center" cellpadding="0" cellspacing="10" bgcolor="#FFFFFF">
    <tr>
      <td align="center">
		<table width="97%" border="0" cellpadding="0" cellspacing="15" bgcolor="#EBF5FE">
          <tr> 
            <td align="center" valign="top" bgcolor="#FFFFFF"><table width="100%" border="0" cellpadding="6" cellspacing="0" class="border2">
                <tr>
                  <td align="center"><table width="100%" border="0" cellspacing="5" cellpadding="0">
                      <tr> 
                        <td width="9%" align="center"><font color="#0066FF"><img src="images/admin_set.gif" width="36" height="36"></font></td>
                        <td width="91%" class="font16"><img src="images/set.gif" width="142" height="28"></td>
                      </tr>
                    </table>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr> 
                        <td> 
                          <?php
	$rs=$db->execute("select * from ".TABLE_PREFIX."gbconfig where id=1");
	if($db->num_rows($rs)!=0)
	{
	$rows=$db->fetch_array($rs);
	$db->free_result($rs);
	}
	?>
                          <table width="100%" border="0" cellspacing="10" cellpadding="8">
                            <tr> 
                              <td width="23%" align="right" valign="top"> <p><br>
                                  <a href="admin_mp.php"><font color="#175CBB">·修管理密码</font></a></p>
                                <p><a href="admin_set.php"><font color="#175CBB">·留言本设置</font></a></p></td>
                              <td width="77%"><table width="403" border="0" align="center" cellpadding="5" cellspacing="5">
                                  <tr> 
                                    <td width="25%" align="right"><font color="#333333">旧密码:</font></td>
                                    <td width="75%"> <input name="admin_pass" type="password" id="admin_pass">
                                      *</td>
                                  </tr>
                                  <tr> 
                                    <td align="right"><font color="#CC3333">新密码:</font></td>
                                    <td> <input name="admin_pass1" type="password" id="admin_pass1">
                                      *</td>
                                  </tr>
                                  <tr> 
                                    <td align="right"><font color="#CC3333">确认新密码:</font></td>
                                    <td> <input name="admin_pass2" type="password" id="admin_pass2">
                                      *</td>
                                  </tr>
                                  <tr> 
                                    <td>&nbsp;</td>
                                    <td> <input type="submit" name="Submit" value=" 确 认 "> 
                                      <input type="button" name="Submit" value="取 消" onClick="window.history.back()"> 
                                      <script language=JavaScript>
function FrontPage_Form1_Validator(theForm)
{
  if (theForm.admin_pass.value == "")
  {
    alert("请填写原密码!");
    theForm.admin_pass.focus();
    return (false);
  }
   if (theForm.admin_pass1.value == "")
  {
    alert("新密码还没有填呢!!");
    theForm.admin_pass1.focus();
    return (false);
  }
  if (theForm.admin_pass1.value.length<=2)
  {
    alert("密码过于简单!最低3个字符");
    theForm.admin_pass1.focus();
    return (false);
  }
  if (theForm.admin_pass2.value == "")
  {
    alert("确认密码还没有填!!");
    theForm.admin_pass2.focus();
    return (false);
  }
  if (theForm.admin_pass1.value != theForm.admin_pass2.value)
  {
    alert("密码不一致!!!");
    theForm.admin_pass1.focus();
    return (false);
  }
  return (true);
}
</script> <input name="ac" type="hidden" id="ac" value="reply"></td>
                                  </tr>
                                </table></td>
                            </tr>
                          </table></td>
                      </tr>
                    </table></td>
                </tr>
              </table></td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
</form>
<?php }else{?>
<table width="750" border="0" align="center" cellpadding="0" cellspacing="10" bgcolor="#FFFFFF">
  <tr> 
    <td><table width="97%" border="0" align="center" cellpadding="0" cellspacing="15" bgcolor="#EBF5FE">
        <tr> 
          <td align="center" bgcolor="#FFFFFF"><table width="100%" border="0" cellpadding="6" cellspacing="0" class="border2">
              <tr>
                <td align="center"> 
                  <?php
	include 'include/config.php';
	//echo md5($_POST['admin_pass']);
	$rs=$db->execute("select admin_pass,admin_user from ".TABLE_PREFIX."gbconfig where admin_pass='".md5($_POST['admin_pass'])."' and id=1");
	if($db->num_rows($rs)!=0){
		$db->update("update ".TABLE_PREFIX."gbconfig set admin_pass='".md5($_POST["admin_pass1"])."' where id=1");
			echo "<img src=\"images/success.gif\"> <font style=font-size:12pt;color=green>修改成功,请稍候……</font><br><a href=".$pageUrl.">如果浏览器没有自动返回,请点击此处返回</a>";
			echo "<meta http-equiv=\"refresh\" content=\"2; url=".$pageUrl."\">";
	}else{
			echo "<img src=\"images/error.gif\"><br><font style=font-size:12pt;color=green>操作失败!原始密码不正确,正在返回……</font><br><a href=".$pageUrl.">如果浏览器没有自动返回,请点击此处返回</a>";
			echo "<meta http-equiv=\"refresh\" content=\"2; url=".$pageUrl."\">";
	}
	$db->free_result($rs);
?>
                </td>
              </tr>
            </table></td>
        </tr>
      </table></td>
  </tr>
</table>
<?php }?>
<?php include 'include/foot.php';?>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -