<!DOCTYPE html>
<html>
<script type="text/javascript" src="jquery-1.11.3.min.js"></script>
<style type="text/css">
table.imagetable {
font-family: verdana,arial,sans-serif;
font-size:11px;
color:#333333;
border- 1px;
border-color: #999999;
border-collapse: collapse;
}
table.imagetable th {
background:#b5cfd2 url('cell-blue.jpg');
border- 1px;
padding: 8px;
border-style: solid;
border-color: #999999;
}
table.imagetable td {
background:#dcddc0 url('cell-grey.jpg');
border- 1px;
padding: 8px;
border-style: solid;
border-color: #999999;
}
</style>
<script type="text/javascript">
function dele($id){
var id=$id;
if(id){
$.get("delete.php",{'id':id},function(data){
if(data==200){alert("1");
window.location.href=window.location.href;
}
else{
alert("2");
}
});
}
}
</script>
<body>
<table class="imagetable">
<tr>
<th>id</th><th>name</th><th>pwd</th><th>sex</th><th>class1</th><th>tel</th><th>操作</th>
</tr>
<?php
header( 'Content-Type:text/html;charset=utf-8 ');
include_once("conn/conn.php");
$sql="select * from user ";
$r=mysqli_query($link,$sql);
$row=mysqli_fetch_array($r);
while ($row=mysqli_fetch_array($r)) {
?>
<tr>
<td><?php echo $row["id"] ?></td>
<td><?php echo $row["name"] ?></td>
<td><?php echo $row["pwd"] ?></td>
<td><?php echo $row["sex"] ?></td>
<td><?php echo $row["class1"] ?></td>
<td><?php echo $row["tel"] ?></td>
<td><a href="" onclick="dele(<?php echo $row["id"] ?>);">删除</a></td>
</tr>
<?php
}
?>
</body>
</html>