PDA

View Full Version : Simple search


petra_itl
12-23-2003, 12:23 AM
Hi,

I am testing PhpDig on my site (www.pathway.gr) in order to replace google search. I am new to php and I wonder if there is a way to make search more simple: to have a fixed number of displayed results eg. 10 and by default search any part of a word, so the user must enter just a "word" and the go button.

Thank you in advance

John

Charter
12-23-2003, 07:19 AM
Hi. Just change the following in the config.php file:

define('SEARCH_DEFAULT_LIMIT',10); // results per page
define('SEARCH_DEFAULT_MODE','start'); // default search mode (start|exact|any)

and then use something like the following HTML in the page:

<form action="CHANGE_ME/search.php" method="post">
<table>
<tr>
<td><input name="query_string" type="text" size="35"></td>
<td><input name="search" type="submit" value="Go"></td>
</tr>
</table>
</form>

petra_itl
12-24-2003, 01:20 AM
it works fine,

if i do manage to make it work correctly with greek and latin characters it would be perfect.


Thank you

John

Charter
12-30-2003, 07:17 AM
Hi. For Greek and Latin support check out this (http://www.phpdig.net/showthread.php?threadid=135&perpage=15&pagenumber=2) thread.