PDA

View Full Version : can't figure out how to include search


g0ng
12-19-2005, 02:09 AM
I read some of the posts here but still can;t understand.

What I want is
1)Insert a simple box where someone can write a query.
2)Use a search.php to show the results.

In my menu I do:

$q.="<form action=\"search.php\" method=\"get\">\n";
$q.="<input type='hidden' name='template' value=''> <input type='hidden' name='site' value=''/><input type='hidden' name='path' value=''/>\n";
$q.="<input type='hidden' name='result_page' value='http://www.deypsy.gr/search.php'/>\n";
$q.="<input type=\"text\" name=\"query_string\" /></form>\n";

my search.php is:
$no_connect=0;
$relative_script_path = 'phpdig';
include("phpdig/includes/config.php");
include("phpdig/includes/connect.php");
include("phpdig/libs/search_function.php");

print "lala";
extract(phpdigHttpVars(
array('query_string'=>'string',
'template'=>'string',
'refine'=>'integer',
'refine_url'=>'string',
'site'=>'integer',
'limite'=>'integer',
'option'=>'string',
'search'=>'string',
'lim_start'=>'integer',
'browse'=>'integer',
'path'=>'string'
)
));
phpdigSearch($id_connect, $query_string, $option, $refine,$refine_url, $lim_start, $limite, $browse, $site, $path, $relative_script_path, $template, $adlog_flag, $rssdf);
?>


No when I search for a term it redirects me to search.php with a small search table. If I press go it then searches. (that means it requires 2 steps to search)

I don't understand what is wrong with this.
and one more question. Can I include the search results in my html pages? I have my menus, etc and what to do something like: <?php print searchResults();?>

tahnks

ps: you can see www.deypsy.gr though it's in greek you will understand the search input. ;-)

alexp_p
12-26-2005, 07:02 PM
I'm also new and did my own search with no trouble but i think it need to use POST instead of GET metho in the form, i used that why and works hope this help