Hello all,
I just found the one topic talk about search by field, but i think the code is something wrong coz of new update forum:
--------------------------------------------------------------------------------
Ok. Here are semi- step by step instructions.
Open up search.cgi
under:
# Go through the database.
open (DB, "<$db_file_name") or &cgierr("error in search. unable to open database: $db_file_name. Reason: $!");
flock (DB, 1) if ($db_use_flock);
LINE: while (<DB> ) {
/^#/ and next LINE; # Skip comment Lines.
/^\s*$/ and next LINE; # Skip blank lines.
chomp; # Remove trailing new line.
@values = &split_decode($_);
$grand_total++;
add:
if ($in{'category'}){
($in{'category'} eq $valuesUnrecognized tag '$db_category') or next LINE;
}
Make the category in $in{'category'} set to the term you send in through the site_html for searches. Make the category in $db_category equal to the field in the database.
You can add as many fields as you like.
Now open site_html.pl
In sub site_html_search, add:
<select name=database_field><option>option 1<option>option 2<option>etc....</select>
Set database_field to the name you used in search.cgi for category in the statement $in{'category'}
Everything should work now.
Will somebody tell me what the real code for this $valuesUnrecognized
Please help and thanks.
I just found the one topic talk about search by field, but i think the code is something wrong coz of new update forum:
Quote:
Subject: Re: Wanted: mod for search on specific fields Can't Post --------------------------------------------------------------------------------
Ok. Here are semi- step by step instructions.
Open up search.cgi
under:
# Go through the database.
open (DB, "<$db_file_name") or &cgierr("error in search. unable to open database: $db_file_name. Reason: $!");
flock (DB, 1) if ($db_use_flock);
LINE: while (<DB> ) {
/^#/ and next LINE; # Skip comment Lines.
/^\s*$/ and next LINE; # Skip blank lines.
chomp; # Remove trailing new line.
@values = &split_decode($_);
$grand_total++;
add:
if ($in{'category'}){
($in{'category'} eq $valuesUnrecognized tag '$db_category') or next LINE;
}
Make the category in $in{'category'} set to the term you send in through the site_html for searches. Make the category in $db_category equal to the field in the database.
You can add as many fields as you like.
Now open site_html.pl
In sub site_html_search, add:
<select name=database_field><option>option 1<option>option 2<option>etc....</select>
Set database_field to the name you used in search.cgi for category in the statement $in{'category'}
Everything should work now.
Will somebody tell me what the real code for this $valuesUnrecognized
Please help and thanks.