Show No Results if No Search Criteria Chosen
Trying to use the following directions to restrict the results when no search criteria is chosen. I added this to my results page and I get an error message when I do so. Also, not sure I understand what field keywords need to be added to. Can you further explain because I'm trying to accomplish the same thing.
Thanks
The search works as a filter, so without a filter the default is to return no results.
If you wanted a blank search to return no results, one option might be to automatically populate with a value that would have no result on the top of the results page:
Code:
<?php
if (isset($_POST['keywords"]) && $_POST['keywords"] == "") {
$_POST['keywords"] = "zznoresultszz";
}
?>if this was added to the top of your results page and a field named "keywords" was submitted in your search it would search for "zznoresultszz" instead of a blank search and would return no results.