I wanna make that only same user loged in and posted can delet the crud post how do i do that?
<?php
include("db.php");
if(isset($_GET['id'])) {
$id = $_GET['id'];
$query = "DELETE FROM task WHERE id = $id";
//$sql = "delete from tblusers WHERE id=:id and user_id=:user_id";
$result = mysqli_query($conn, $query);
if(!$result) {
die("Query Failed.");
}
$_SESSION['message'] = 'Task Removed Successfully';
$_SESSION['message_type'] = 'danger';
header('Location: index.php');
}
?>