修改密码,当点击提交时为什么会弹出下面那个选择框pwd_edit.php:
<form id="form" method="post" action="pwd_edit_save.php">
<table class="tab" width="350" cellpadding="5" cellspacing="0" align="center">
<th colspan="2">
<p>需要修改用户为:<?php echo $row['name']; ?></p>
</th>
<tr>
<th width="150">原始密码</th>
<td><input name="pwd" type="password" id="pwd"/></td>
</tr>
<tr>
<th>新密码</th>
<td><input name="pwd2" type="password" id="pwd2"/></td>
</tr>
<tr>
<th>确认新密码</th>
<td><input name="pwd3" type="password" id="pwd3"/></td>
</tr>
<tr>
<th colspan="2">
<input name="uid" type="hidden" value="<?php echo $row['uid']; ?>" />
<input name="put" type="submit" id="put" value="提交"/>
</th>
</tr>
</table>
</form>
<form id="form" method="post" action="pwd_edit_save.php">
<table class="tab" width="350" cellpadding="5" cellspacing="0" align="center">
<th colspan="2">
<p>需要修改用户为:<?php echo $row['name']; ?></p>
</th>
<tr>
<th width="150">原始密码</th>
<td><input name="pwd" type="password" id="pwd"/></td>
</tr>
<tr>
<th>新密码</th>
<td><input name="pwd2" type="password" id="pwd2"/></td>
</tr>
<tr>
<th>确认新密码</th>
<td><input name="pwd3" type="password" id="pwd3"/></td>
</tr>
<tr>
<th colspan="2">
<input name="uid" type="hidden" value="<?php echo $row['uid']; ?>" />
<input name="put" type="submit" id="put" value="提交"/>
</th>
</tr>
</table>
</form>
include 'db.php';
include 'chk_userpower.php';
$pwd=$_POST['pwd'];
$pwd2=$_POST['pwd2'];
$pwd3=$_POST['pwd3'];
$uid=$_POST["uid"]; if ($pwd3==$pwd2) {
$sql="SELECT * FROM user WHERE uid='{$uid}'";
$result = $db->query($sql);
if ($result && $row=$result->fetch_assoc() ){
if($pwd==$row["pwd"]){
$sql="UPDATE user SET pwd='{$pwd2}' WHERE uid={$uid}";
$result = $db->query($sql);
if($result && $db->affected_rows>0){
echo '<script language="javascript">';
echo 'alert("修改成功");';
echo 'location="user_mag.php"';
echo '</script>';}
}else{
echo '<script language="javascript">';
echo 'alert("密码不一致,请重新输入!");';
echo 'location="pwd_edit.php"';
echo '</script>';
}
}
}else{
echo '<script language="javascript">';
echo 'alert("密码不一致,请重新输入!");';
echo 'location="pwd_edit.php"';
echo '</script>';
}
$result->free_result;
$db->close;
?>这个是浏览器的弹窗,但是不知道为什么会有