case 'delUser':
$id=$_GET['id'];
$sql="delete from user where id=".$id;
$res=$mysqli->query($sql);
if($res){
$msg="删除成功";
}else{
$msg="删除失败";
}
alertMsg($msg);
default :
}
function alertMsg($msg) {
echo "<script>alert('$msg');location.href='List.php';</script>";
}
$id=$_GET['id'];
$sql="delete from user where id=".$id;
$res=$mysqli->query($sql);
if($res){
$msg="删除成功";
}else{
$msg="删除失败";
}
alertMsg($msg);
default :
}
function alertMsg($msg) {
echo "<script>alert('$msg');location.href='List.php';</script>";
}
2017-10-15
php入门:基础语法到实际应用 难怪觉得老师声音熟悉 看的时候还在想,是这个老师厉害还是那个老师厉害 结果发现是同一个老师 哈哈
2017-09-27