<?php
include("../includes/connect.php");

$postcode = $_POST['postcode'];

$comuni = $connection->query("SELECT DISTINCT locality FROM geopc_places WHERE postcode='$postcode'");

$citta = $comuni->fetchAll(PDO::FETCH_COLUMN);

sort($citta);

if(count($citta) > 0)
{
	$citta = json_encode($citta);
	echo "{\"success\":true,\"cities\": $citta }";
}
else
{
	echo "{\"success\":false\" }";	
}

?>

