对于Web应用程序,我构建删除用户功能已停止工作。我没有改变与此功能相关的任何内容。所以我非常困惑。 我在chrome(和应用程序)中安装了PHP控制台。但它没有给出任何错误或警告。
我使用bootbox验证用户是否确实应该被删除:
$("span.click").click(function() {
$(".map").animate(
{"opacity": "1"}, 200);
});
$("span.click").click(function() {
$(".navigation").animate(
{"bottom": "-100px"}, 200);
});
$("span.click").click(function() {
$(".click").animate(
{"bottom": "150px"}, 200);
});
然后它应该通过我的php函数传递:
function delete_id(id, fullname) {
bootbox.confirm({
size: 'small',
message: '<i class="glyphicon glyphicon-question-sign orange"></i>Are you sure you want to delete user "'+fullname+'"?',
callback: function(result) {
if(result) {
window.location.href = '?delete_id='+id;
}
}
});
}
在function delete_user ($mysqli) {
if(isset($_GET['delete_id'])) {
$sql_name = "SELECT * FROM users WHERE uid='".$_GET['delete_id']."'";
$result_name = $mysqli->query($sql_name);
$row = $result_name->fetch_assoc();
$sql_log = "DELETE FROM loginlog WHERE uid='".$row['uid']."'";
$result_log = $mysqli->query($sql_log);
$sql_user = "DELETE FROM users WHERE uid='".$row['uid']."'";
$result_user = $mysqli->query($sql_user) or die(mysqli_errno($mysqli));
$_SESSION['success'] = "User \"".$row['firstname']." ".$row['prefix']." ".$row['lastname']."\" is deleted.";
header("location: ".BASE_PATH."/includes/views/users.php");
exit();
}
}
中调用delete_user()
函数
这工作得很好,但现在已经不行了......我忽略了什么吗?