version 1.3, 2001/02/20 15:03:23
|
version 1.4, 2001/02/20 16:48:48
|
Line 33 sub handler {
|
Line 33 sub handler {
|
|
|
my $searchquery; |
my $searchquery; |
my $searchresults; |
my $searchresults; |
|
my @regexps; |
|
my $logic; |
|
my $logic_operator; |
|
|
if ($query->{'SUBMIT'}) { |
if ($query->{'SUBMIT'}) { |
$searchquery="trying to search..."; |
$logic_operator=$query->{'logic'}->[0]; |
|
$searchquery="<BR>Your search was:\n"; |
|
$searchquery.="<BR><STRONG>$_</STRONG>: " . $query->{$_}->[0] . "\n" for ('title','author','subject','notes','abstract','mime','language','creationdate','lastrevisiondate','owner','copyright'); |
|
for ('title','author','subject','notes','abstract','mime','language','creationdate','lastrevisiondate','owner','copyright') { |
|
push @regexps, ($_ . " regexp '" . $query->{$_}->[0] . "'") if $query->{$_}->[0]; |
|
} |
|
$logic="where " . join(" $logic_operator ",@regexps) if @regexps; |
} |
} |
|
my $sqlcommand="SELECT * FROM metadata $logic"; |
|
$searchquery.="<P><STRONG>SQL command:</STRONG> $sqlcommand</P>\n"; |
|
|
$r->content_type('text/html'); |
$r->content_type('text/html'); |
$r->header_out('Cache-control','no-cache'); |
$r->header_out('Cache-control','no-cache'); |