<?php 
if(!isset($_POST['submit']))
{
	header("Location:/local-area-numbers.html");
} else
{
	$fullname = trim($_POST['city']);
	$pos = strpos($fullname," ");
	if($pos == false)
		header("Location:/local-area-numbers.html");
	else
	{
		// if 0207
		if($fullname == '0207 London (Inner)')
		{
			header("Location:/0207-numbers.html");
		} else
		{
	
			$code = substr($fullname,1,$pos-1);
		        $fullcity = substr($fullname, $pos+1);
		        $city = strtolower(str_replace("- ","",str_replace(")","",str_replace("(","",str_replace(" ","-",$fullcity)))));
			$link = '/geographic-numbers/0'.$code.'-numbers-'.$city.'.html';
			header("Location:".$link);
		}
	}
}

?>