1){ $zipsearch = substr($zipsearch,0,5); $format1 = $zipsearch; $format2 = "`zip_code` = $zipsearch"; $format3 = $zipsearch . "/"; } elseif ($string == "Enter A ZipCode or City, State"){ header ( 'Location: http://www.all-foreclosure.com/listings/newsearch.php'); //Newsearch if empty search box } elseif ($string !="Enter Zip Code or City, State"){ //City search if box has something in it $string = str_replace(",", ", ", $string); $semi_string = str_ireplace($stnames, $stabbrs, $string); $final_string = str_replace(",", "", $semi_string); preg_match('/(.*?)\s+([A-Za-z]{2}$)/', $final_string, $matches); $city = $matches[1]; $state = $matches[2]; $state = strtoupper ($state); } //end elseif if ($state != ""){ $citysearch = substr($city,0,35); $citysearch = ucwords($citysearch); $state = substr($state,0,2); $modcity = str_replace(" ", "_", $city); $format1 = $citysearch . ", " . $state; $format2 = "`city` = '$citysearch' AND `state` = '$state'"; $format3 = $state . "/" . $modcity . "/"; } ?> Foreclosures Search by Zip Code or City
Foreclosures and Auctions in " . $format1 . "" ?>