<?php

include "../config/db.php";

$host = $_SERVER['HTTP_HOST'];
$slug = str_replace('.gramadhikar.com', '', $host);

$query = mysqli_query($conn, "SELECT * FROM villages WHERE slug='$slug'");
$village = mysqli_fetch_assoc($query);

if(!$village){
    die("Village not found");
}

$village_id = $village['id'];

?>