<?php 
include("connection/conn.php");

if (empty($_SESSION['adminuser'])) {
    header("location:index.php");
    exit();
}

if (isset($_GET['id'])) {
    $id = intval($_GET['id']);
    $delete_query = "DELETE FROM subjects WHERE id=$id";
    if (mysqli_query($link, $delete_query)) {
        header("location: manage-subjects.php");
    }
}
?>