📄 moduser.php
字号:
<?
session_start();
include("../conn.php");?>
<? include("../include/function.php");?>
<?
$id=$_GET[id];
$manager=$_SESSION[manager];
if($manager!="oktop"){
header("Location:error.htm");
}
$what=$_POST[what];
if ($what=="update") {
$oldpsw=trim($_POST[oldpsw]);
$psw=trim($_POST[psw]);
$username=trim($_POST[username]);
$email=trim($_POST[email]);
$userid=$_POST[userid];
$sql="select * from myuser where userid='".$userid."' limit 1";
$query=mysql_query($sql);
if($arr=mysql_fetch_array($query))
{
$sql="update myuser set username='$username',";
if($psw!=""){
$sql.=" psw='$psw',";
}
$sql.=" email='$email' where userid='$userid' limit 1";
mysql_query($sql);
$msg="基本信息修改成功!";
}
}
?>
<html>
<head>
<meta http-equiv="content-Type" content="text/html; charset=gb2312">
<title>用户管理</title>
<link href="../style/default.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="300" border="0" cellspacing="21" align="center">
<tr class="Notice">
<td align="center" id="msg"><? echo $msg;?></td>
</tr>
</table>
<?
$qr=mysql_query("select * from myuser where id='$id' limit 1");
$rs=mysql_fetch_array($qr);
$userid=$rs[userid];
$username=$rs[username];
$email=$rs[email];
?>
<form name="form1" method="post" action="moduser.php?id=<? echo $id;?>" style="margin-bottom:0;margin-top:0">
<table width="760" border="0" cellspacing="6" cellpadding="0" align="center">
<tr>
<td width="40%" align="right">用户id:</td>
<td width="60%"><input name="userid" type="text" id="userid" maxlength="30" value="<? echo $userid;?>" readonly> (不可以修改)</td>
</tr>
<tr>
<td width="40%" align="right">用户名称:</td>
<td width="60%"><input name="username" type="text" id="username" maxlength="100" value="<? echo $username;?>"> </td>
</tr>
<tr>
<td align="right">原密码:</td>
<td><input name="oldpsw" type="text" id="oldpsw" value="<? echo $rs[psw];?>">
<span class="Notice" id="soldpsw">*</span></td>
</tr>
<tr>
<td align="right">新密码:</td>
<td><input name="psw" type="password" id="psw" value="">
(为空表示不修改)
<span class="Notice" id="spsw"></span></td>
</tr>
<tr>
<td align="right">重复新密码:</td>
<td><input name="Repsw" type="password" id="Repsw" value="">
<span class="Notice" id="sRepsw"></span></td>
</tr>
<tr>
<td align="right">email:</td>
<td><input name="email" type="text" id="email" value="<? echo $email;?>">
<span class="Notice" id="semail">*</span></td>
</tr>
<tr align="center">
<td colspan="2"><input type="submit" name="Submit" value="修改注册信息">
<input name="userid" type="hidden" id="userid" value="<? echo $userid;?>">
<input name="what" type="hidden" id="what" value="update"></td>
</tr>
</table>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -