PDA

View Full Version : "limit to" option on from page?


atticus1214
03-03-2004, 06:20 AM
hi i just want to say that i am very impressed with preformance of this search engine. i had one question though. i have a sub navigation menu, on the menu i have add the search function as so:
<form action='http://mywebsite.com/search/search.php' target="template_content" method='get'>
<input type='hidden' name='template_demo' value=''/>
<input type='hidden' name='site' value=''/>
<input type='hidden' name='path' value=''/>
<input type='hidden' name='result_page' value='search.php'/>
<input class='liwords' type='text' name='query_string'/>
<input class='liwords' type='submit' name='search' value='Search'/>
</form>
what i would like to do is give the user the ablity to search the whole site (which it does at this point) or select "search this directory only" which would give results for the current folder and everything under. i know this option is avalible from the results page but i would like to give the option from the search prompt. i figure it has something to do with the script above labeled "name='path'" but i am unsure of the syntax. any support would be greatly appreciated.

thank you,
atticus1214

oh yeah - my search engine is on a different webhost, so relative path stuff doesn't really work.
(i dont really know what i'm talking about - relative path is like "../../foldername" right?)

Charter
03-03-2004, 10:12 AM
Hi. Perhaps the code in this (http://www.phpdig.net/showthread.php?threadid=580) thread will help.

atticus1214
03-03-2004, 11:59 AM
in the part that i add to function_phpdig_form.php were do i specify what path to search. i want the drop down menu to default at "www.mysite.com/library" on the library page but on the downloads page to default to "www.mysite.com/downloads." however on both pages i want the user to be able to select "Search Whole Site" searching "www.mysite.com"

i read the post at the link you gave and that sounds very close to what i want to do but i am not using an array (that i know of - i didnt make any changes to the script in that fashion). also the form is not on the template html page. it is on a subnavigation frame and the results dispay on a results_content frame. it is very possible that the script you are reffering to is exactly what in need, however i guess i dont understand how to apply it to my specific needs.

thank you for your time,
atticus1214

Charter
03-03-2004, 01:05 PM
Hi. Not tested, but you could try to add a switch (http://www.php.net/manual/en/control-structures.switch.php) statement right before the phpdigSearch function call in the search.php file, where the variable used is one of the server predefined (http://www.php.net/reserved.variables) variables. As for code to do this, I just don't have the time to continue coding (http://www.phpdig.net/showthread.php?threadid=587) individual requests. Perhaps another member would be willing to code this for you.