search string
Hey Ray
Am trying to get a search by postcode working. As am sure youre aware, UK postcode look like SW6 3AH - in the database, I have set it so that the space is removed and the code is just 1 long string.
What am not sure how to do is in the search form to remove the space when the visitor types in SW6 3AH as people can type in either SW6 3AH or SW63AH
Also, how would I make the search search exactly by SW6 3AH?
<?php
$searchMaps_1 = new WA_MySQLi_Search("Maps","");
if (isset($_POST["WADbSearch1"]) || isset($_POST["WADbSearch1_x"])) {
$searchMaps_1->clearSearch();
$searchMaps_1->setSearch(array("type"=>"Key", "comparison"=>"Includes", "join"=>"AND", "and"=>", ", "or"=>" ", "start_encap"=>"\"", "end_encap"=>"\""), array("GalleryTags"), "s", "".((isset($_POST["SearchContent"]))?$_POST["SearchContent"]:"") ."");
}
?>
<form action="maps.php" method="post" id="searchForm" name="searchForm" class="form-container searchForm">
<input value="" name="SearchContent" type="text" class="postcodeINput" placeholder="search by Post Code">
<button type="submit" class="searchButton" name="WADbSearch1" value="1">SEARCH</button>
<button type="button" class="searchButton" onclick="document.location.href='maps.php?reset=true'">CLEAR</button>
</form>
Cheers