I can not see any successful message on the browser if I click on delete button. and again I notice that ones I comment out unset function
unset($_SESSION['message']);
unset($_SESSION['msg_type']);
that message will display on the browser but the issue is that the message will still on even though I refresh my page, please what could be the issue now.
My codes:
if(isset($_GET['delete'])){
$id = $_GET['delete'];
$db->query("DELETE FROM music WHERE id=$id") or die($db->error());
$_SESSION['message'] = "Rocord has been deleted!";
$_SESSION['msg_type'] = "danger";
header("location: music.php");
}
//display message
<?php
session_start();
if(isset($_SESSION['message'])):?>
<div class="alert alert-<?=$_SESSION['msg_type']?>">
<?php
echo $_SESSION['message'];
unset($_SESSION['message']);
unset($_SESSION['msg_type']);
?> </div>
<?php endif ?>