You are here:  » search only if searchword > 2 signs

Support Forum



search only if searchword > 2 signs

Submitted by Harry on Thu, 2009-02-26 09:29 in

Hello David,

the search function should only work if the search string has more than 2 signs.
How can I do this?

Regards,
Harry

Submitted by support on Thu, 2009-02-26 09:40

Hello Harry,

You can prevent the search if the query is less than or equal to 2 characters quite easily. Near the top of search.php, look for the following code on line 12:

if ($q)

..and REPLACE this with:

if (strlen($q)>2)

Cheers,
David.