config_manage_info.php
资源名称:Nsix.rar [点击查看]
上传用户:m68239277
上传日期:2014-10-12
资源大小:824k
文件大小:4k
源码类别:
Web服务器
开发平台:
PHP
- <?php
- session_start();
- include("checks.php");
- include("../inc/conn.php");
- include("../inc/base_status.inc.php");
- $_SESSION["menus"]="修改管理资料";
- if(isset($_GET["act"]))
- { $act=$_GET["act"];
- if($act=="add")
- {
- $username=$_POST["add_admin"];
- $add_pwd1=$_POST["add_pwd1"];
- $add_pwd2=$_POST["add_pwd2"];
- $password=md5($add_pwd1);
- if($username=="")
- {
- echo "请输入用户名!";
- }elseif($add_pwd1==""||$add_pwd2=="")
- {
- echo "请输入用户密码!";
- }elseif($add_pwd1<>$add_pwd2)
- {
- echo "两次密码不一致!";
- }else
- {
- $sqls=mysql_query("insert into admin(username,password)values('$username','$password')",$conn);
- if($sqls) echo "添加成功!";
- mysql_query("insert into pice(contents,user_account)values('10000','$username')",$conn);
- }
- }elseif($act=="mod")
- {
- $id=$_POST["id"];
- $username=$_POST["mod_admin"];
- $mod_pwd1=$_POST["mod_pwd1"];
- $mod_pwd2=$_POST["mod_pwd2"];
- $password=md5($mod_pwd1);
- if($username=="")
- {
- echo "请输入用户名!";
- }elseif($mod_pwd1==""||$mod_pwd2=="")
- {
- echo "请输入用户密码!";
- }elseif($mod_pwd1<>$mod_pwd2)
- {
- echo "两次密码不一致!";
- }else
- {
- $sqls=mysql_query("update admin set username='$username',password='$password' where ID='$id'",$conn);
- if($sqls) echo "修改成功!";
- }
- }elseif($act=="del")
- {
- $id=$_GET["id"];
- mysql_query("delete from admin where ID='$id'",$conn);
- }
- }
- $sqlr=mysql_query("select * from admin ",$conn);
- ?>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
- <link href="../css/css.CSS" rel="stylesheet" type="text/css">
- <title></title>
- <style type="text/css">
- <!--
- body {
- margin-left: 10px;
- }
- -->
- </style></head>
- <body><br><?php include("config_menu.inc.php");?><br>
- <table width="645" height="82" border="0" align="left" cellpadding="0" cellspacing="0" class="tmove">
- <tr>
- <td height="82" valign="top"><table width="645" height="78" border="0" cellpadding="0" cellspacing="1" class="t12">
- <tr class="t11">
- <td width="154" height="22"><div align="center" class="fw12">用户名</div></td>
- <td width="174"><div align="center" class="fw12">新密码</div></td>
- <td width="197"><div align="center" class="fw12">确认密码</div></td>
- <td width="120"><div align="center" class="fw12">功能</div></td>
- </tr>
- <?php while($rs=mysql_fetch_array($sqlr))
- { ?><form name="form2" method="post" action="config_manage_info.php?act=mod&menu=4">
- <tr class="t17">
- <td height="28"><div align="center">
- <input name="mod_admin" type="text" class="input" id="mod_admin" value="<?=$rs["username"]?>" size="15" maxlength="15">
- </div></td>
- <td><div align="center">
- <input name="mod_pwd1" type="password" class="input" id="mod_pwd1" value="<?=$rs["password"]?>" size="16" maxlength="16" onClick="this.value='';">
- </div></td>
- <td><div align="center">
- <input name="id" type="hidden" id="id" value="<?=$rs["ID"]?>">
- <input name="mod_pwd2" type="password" class="input" id="mod_pwd2" value="<?=$rs["password"]?>" size="16" maxlength="16" onClick="this.value='';">
- </div></td>
- <td><div align="center">
- <input type="submit" name="Submit" value="修改">
- <input type="button" name="Submit2" value="删除" onClick="javascript:window.location.href='config_manage_info.php?act=del&id=<?=$rs["ID"]?>'">
- </div></td>
- </tr> </form><? }?> <form name="form3" method="post" action="config_manage_info.php?act=add&menu=4">
- <tr class="t17">
- <td height="28"><div align="center">
- <input name="add_admin" type="text" class="input" id="add_admin" size="15" maxlength="15">
- </div></td>
- <td><div align="center">
- <input name="add_pwd1" type="password" class="input" id="add_pwd1" size="16" maxlength="16">
- </div></td>
- <td><div align="center">
- <input name="add_pwd2" type="password" class="input" id="add_pwd2" size="16" maxlength="16">
- </div></td>
- <td><div align="center">
- <input type="submit" name="Submit" value="添加">
- </div></td>
- </tr> </form>
- </table></td>
- </tr>
- </table>
- <p> </p>
- <p> </p>
- </body>
- </html>