session_start();
if (!isset($_SESSION['admin'])) {
    header("Location: ../auth/login.php");
    exit;
}
<?php
include("../config/db.php");

if (isset($_POST['submit'])) {
    $name = $_POST['name'];

    $conn->query("INSERT INTO districts (name) VALUES ('$name')");
    header("Location: index.php");
}
?>

<?php include("../includes/header.php"); ?>
<?php include("../includes/sidebar.php"); ?>

<h3>Add District</h3>

<form method="POST">
    <div class="mb-3">
        <label>District Name</label>
        <input type="text" name="name" class="form-control" required>
    </div>

    <button name="submit" class="btn btn-success">Save</button>
</form>

<?php include("../includes/footer.php"); ?>