Undefined array key in ajax call

Hi,
I am getting undefined array key ‘home_id’ and ‘road_id’ in village.php. Seems like ajax is not passing the data to village.php file. How do I pass the data?

index.php

$("#add-to-area").on("click", function() {
	
	var home = <?= $home_id; ?>;
	var road = <?= $road_id; ?>;
	
	$.ajax({
		url: "../../area/town/village.php",
		data: {home_id: home, road_id: road}, 
		type: "POST",
		success: function(response) {
			//
		}
	})
})

village.php

include("../all/conn.php");

$home_id = $_POST["home_id"];
$road_id = $_POST["road_id"];

$sql = "INSERT INTO township (home_id, road_id) VALUES ('{$home_id}', '{$road_id}')";

if(mysqli_query($conn, $sql))
{
	echo 1;
}
else
{
	echo 0;
}

Never mind. My code is working correctly, there is something in my server which is preventing it to pass.