<td><a href="pages/xiugai.php?id=<?php echo $row["id"]?>">修改</a></td>
<?php
header('Content-Type:text/html;charset=utf-8');
include_once("../conn/conn.php");
$id=$_GET["id"];
$sql="SELECT * from user where id=$id";
$r=mysqli_query($link,$sql);
while($row=mysqli_fetch_array($r)){
?>
<input type="hidden" value="<?php echo $row['id'] ?>" id="id"></br>
<input type="text" id="name" value="<?php echo $row['name'] ?>"></br>
<input type="text" id="password" value="<?php echo $row['password'] ?>"></br>
<input type="text" id="sex" value="<?php echo $row['sex'] ?>"></br>
<input type="text" id="college" value="<?php echo $row['college'] ?>"></br>
<input type="text" id="class" value="<?php echo $row['class'] ?>"></br>
<input type="text" id="tel" value="<?php echo $row['tel'] ?>"></br>
<input type="submit" id="queding" value="确定" style="
<script src="../js/jquery.js"></script>
<script type="text/javascript" src="../js/jquery-1.11.3.min.js"></script>
<script type='text/javascript' src='../js/jquery-1.4.4.min.js'></script>
<script type="text/javascript">
$(document).ready(function(){
$("#queding").click(function(){
var id=$("#id").val();
var name=$("#name").val();
var password=$("#password").val();
var sex=$("#sex").val();
var college=$("#college").val();
var ban=$("#class").val();
var tel=$("#tel").val();
$.post("update.php",{"id":id,"name":name,"password":password,"sex":sex,"college":college,"ban":ban,"tel":tel},function(data){
if(data==200){
alert("更新成功");
window.location.href="../index_ok.php";//页面自动刷新
}
});
});
});
</script>
<?php
}
?>