$v) header("Location: $v"); } if ($townArray == "") { $error = "Sorry, there were no results found for City/Town Search of: " . htmlentities(urlencode($City)) . ""; } } elseif ($Submit3 && $_REQUEST["Zip"] != "") { $Zip = rtrim($_REQUEST["Zip"]); $sqlTown = "SELECT SQL_CACHE * from counties,towns,zip where zip = '". mysql_real_escape_string($Zip) ."' and town_active != 0 and town_name = city and county_id = town_county_id"; $resultTown = @mysql_query( $sqlTown ) or die(); $townArray = ""; $City = $_REQUEST["Zip"]; while($rowTown = mysql_fetch_assoc($resultTown)) { $townArray[$rowTown["town_name"]] = "town.php?t=$rowTown[town_name]"; } if (count($townArray) == 1 && $townArray != "") { foreach($townArray as $k => $v) $values = explode("/", $v); header("Location: " . $values[0]); } if ($townArray == "") { $error = "Sorry, there were no results found for Zipcode: " . htmlentities(urlencode($Zip)) . ""; } } else { $error = "Please enter search criteria."; } if ($_REQUEST["show_towns"]) { $error = false; } $sqlCounty= "SELECT SQL_CACHE * from counties where county_active = 1 order by RAND()"; $resultCounty = @mysql_query( $sqlCounty ) or die(mysql_error()); $rowCounty = mysql_fetch_assoc($resultCounty); $showImage = "-$rowCounty[county_folder]"; if ($_REQUEST["Zip"]) { $h1 = "City & Town Index"; } else { $h1 = "Search Results"; } ?> Local: Maine.gov
  1. Home
  2. » Local

Local

There were multiple matches for your search of ". htmlentities(urlencode($City)) .":

"; foreach($townArray as $k => $v) echo "

$k

"; } if ($error) { echo "

$error

 

 

 

"; } if ($_REQUEST["show_towns"]) { // print the headers $module = "

"; for ($i=65; $i<=90; $i++) { $module .= "" . chr($i) . ""; if ($i != 90) $module .= " | "; } $module .= "

"; // print the towns for ($i=65; $i<=90; $i++) { $module .= "

" . chr($i) . "

"; $resultTowns = @mysql_query( "SELECT county_folder, town_name, town_folder FROM towns, counties WHERE town_county_id = county_id AND town_active = 1 AND town_name like '" . chr($i) . "%' ORDER by town_name" ) or die(mysql_error()); while ($data = mysql_fetch_row($resultTowns)) { $module .= "$data[1] | "; } } echo $module; } ?>