<?php ob_start();
include 'connection.php';
session_start();
if (!isset($_SESSION['is_logged_in'])) {
    header("Location:login.php");
    die();
    }
?>
<?php 

$category_id = $_GET['category_id'] ?? 0;

if ($category_id > 0) {
    mysqli_query($conn, "DELETE FROM category_master WHERE category_id = '$category_id'");
}

header("Location: view_all_category.php");
exit;
