记录添加到数据库或从数据库删除后的PHP通知消息

时间:2019-07-16 20:23:22

标签: php alert

我有delete.php页,代码:

<?php
require $_SERVER['DOCUMENT_ROOT'].'/config/db.php';

$id = $_GET['id'];

$sql = "DELETE FROM `items` WHERE id = '$id'";
if (mysqli_query($con, $sql)) {

    header("location: ../../items-list.php");

    echo '<script language="javascript">';
    echo '$.notify("Deleted");';
    echo '</script>';
} 
mysqli_close($con);
?>

还有另一页items-list.php,表中列出了项目。我正在从数据库中删除项目,如下所示:

echo "<td>
        <a href=\"config/delete.php?id=$row[id]\">
            <span style=\"color: #e96875;\">
            <i class=\"zmdi zmdi-delete zmdi-hc-fw\"></i>
            </span>
        </a>
      </td>";

我想在items-list.php页中显示带有文本“已删除”的弹出通知。我该怎么办?

0 个答案:

没有答案