Gossamer Forum
Home : Products : Links 2.0 : Customization :

Search Word Mod?

Quote Reply
Search Word Mod?
Is there a mod that will keep a file on what words or phrases have been search through my links program
Quote Reply
Re: [LordStryfe] Search Word Mod? In reply to
Yes, the 3 Shestopalov mods, in the resource section has a search term log. Here is the code just for a search term log...

Add this in search.cgi:

Code:
# Word is too common, don't try and sort it, can cause problems. if (($numhits > 50) and (($grand_total * 0.75) < $numhits)) { return "Search term is too common."; } &log2; # Sort the results using build_sorthit found in db.pl.



Add this to bottom of file:

Code:
sub log2 { open (KEYWORDS, ">>$kword_file_name") or &cgierr("Error in search. Cannot open keyword file."); print KEYWORDS $in{'query'}; print KEYWORDS "\|"; print KEYWORDS $ENV{'REMOTE_HOST'}; print KEYWORDS "\|"; print KEYWORDS &get_date; print KEYWORDS "\|"; print KEYWORDS &get_time; print KEYWORDS "\|"; print KEYWORDS $numhits; print KEYWORDS "\n"; close (KEYWORDS); }


In links.cfg add this to the bottom (but above the 1;):

Code:

$kword_file_name="$db_script_path/data/keywords.txt"; #PATH to search log


You will need to create an empty file in the data directory, and name it keywords.txt.


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Search Word Mod? In reply to
Thanks for posting what you did the 3 Shestopalov mods didn't open upon finding it so I think it's a bit outdated. I'll try yours.
Quote Reply
Re: [LordStryfe] Search Word Mod? In reply to
I've made those corrections and got this when searching any term you get this message

Quote:

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@wespreadtheword.net and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/1.3.34 Server at www.wespreadtheword.net Port 80


I've attached the files any suggestions?
Quote Reply
Re: [LordStryfe] Search Word Mod? In reply to
Sounds like a minor error somewhere. Did you create the keywords.txt file in the data directory? Also, I did not see how horrible the code looked when I posted it, this should be easier to work with:

Code:

sub log2 {
open (KEYWORDS, ">>$kword_file_name") or &cgierr("Error in search. Cannot open keyword file.");
print KEYWORDS $in{'query'};
print KEYWORDS "\|";
print KEYWORDS $ENV{'REMOTE_HOST'};
print KEYWORDS "\|";
print KEYWORDS &get_date;
print KEYWORDS "\|";
print KEYWORDS &get_time;
print KEYWORDS "\|";
print KEYWORDS $numhits;
print KEYWORDS "\n";
close (KEYWORDS);
}

And put the sub call on it's own line:
Code:
# Word is too common, don't try and sort it, can cause problems.
if (($numhits > 50) and (($grand_total * 0.75) < $numhits)) {
return "Search term is too common.";
}
&log2;


Leonard
aka PerlFlunkie
Quote Reply
Re: [LordStryfe] Search Word Mod? In reply to
Try the 'sub log2' this way:

Code:
sub log2 {
open (KEYWORDS, ">>$kword_file_name") or &cgierr("Error in search. Cannot open keyword file.");
print KEYWORDS qq~$in{'query'}\|$ENV{'REMOTE_HOST'}\|&get_date\|&get_time\|$numhits\n~;
close (KEYWORDS);
}
Quote Reply
Re: [LordStryfe] Search Word Mod? In reply to
Hi,

There don't seem to be any major boo boos.

Can you try adding this to the top of search.cgi, under the path to perl?

Code:
use CGI::Carp qw(fatalsToBrowser);

Also, try this formatting for the code;


Code:
#!/usr/bin/perl
# -------------
# Links
# -------------
# Links Manager
#
# File: search.cgi
# Description: Searches the database and produces a list of results. If no options are
# given, the script will produce a search form found in site_html.pl.
# Author: Alex Krohn
# Email: alex@gossamer-threads.com
# Web: http://www.gossamer-threads.com/
# Version: 2.01
#
# (c) 1998 Gossamer Threads Inc.
#
# This script is not freeware! Please read the README for full details
# on registration and terms of use.
# =====================================================================
#
# Form Input:
# 'type' : can be either 'keyword' or 'phrase'.
# 'bool' : can be either 'and' or 'or'.
# 'mh' : the maximum number of hits, can be either 10, 25, 50, 100.
# 'nh' : the page hit we are on.
#
# Setup:
# Make sure the require statement below points to the config file.

# Required Librariers
# --------------------------------------------------------

# see if we can catch this friggin error =)
use CGI::Carp qw(fatalsToBrowser);

eval {
($0 =~ m,(.*)/[^/]+,) && unshift (@INC, "$1"); # Get the script location: UNIX /
($0 =~ m,(.*)\\[^\\]+,) && unshift (@INC, "$1"); # Get the script location: Windows \

require "admin/links.cfg"; # Change this to full path to links.cfg if you have problems.
require "$db_lib_path/db_utils.pl";
require "$db_lib_path/links.def";
$build_use_templates ?
require "$db_lib_path/site_html_templates.pl" :
require "$db_lib_path/site_html.pl";
};
if ($@) {
print "Content-type: text/plain\n\n";
print "Error including libraries: $@\n";
print "Make sure they exist, permissions are set properly, and paths are set correctly.";
exit;
}

# ========================================================

eval { &main; }; # Trap any fatal errors so the program hopefully
if ($@) { &cgierr("fatal error: $@"); } # never produces that nasty 500 server error page.
exit; # There are only two exit calls in the script, here and in in &cgierr.

sub main {
# --------------------------------------------------------
%in = &parse_form();

# Display the form if called with no input.
(keys %in <= 0) and &site_html_search_form() and return;

# Set maximum hits -- default to 25.
local $maxhits = 25;
if ($in{'mh'} && (($in{'mh'} == 10) || ($in{'mh'} == 25) || ($in{'mh'} == 50) || ($in{'mh'} = 100))) {
$maxhits = $in{'mh'};
}

# Set search type -- either phrase or keyword. Also build keyword list to search on.
my @search_terms = ();
($in{'type'} eq 'phrase') ?
(@search_terms = ($in{'query'})) :
(@search_terms = split (/\s/, $in{'query'}));

# Set boolean connector and next hits page.
my $bool = $in{'bool'} || 'and';
my $nh = $in{'nh'} || 1;

# Store the search results here.
local (%link_results, @category_results);

# Do the actual search.
my $status = &search (\@search_terms, $bool);
if ($status ne "ok") { &site_html_search_failure ($status); return; }

# Return unless we have results.
((keys %link_results > 0) or ($#category_results >= 0)) or
&site_html_search_failure ("no matching records") and return;

# The HTML used in the output is stored here.
local ($cat_hits, $link_hits, $category_results, $link_results, $next);

# Build the HTML for the category results and store it in "$category_results". Only build the html
# if we are on the first set of link results.
foreach $category (@category_results) {
if ($nh == 1) {
$cat_clean = &build_clean($category);
$linked_title = &build_linked_title ($category);
$category_results .= qq|<li>$linked_title\n|;
}
$cat_hits++;
}
$cat_hits ||= 0;
$lowrange = ($nh-1) * $maxhits + 1;
$highrange = $nh * $maxhits;

# Go through each category of links returned, and build the HTML. Store in hash %link_output.
SETOFLINKS: foreach $setoflinks (sort keys %link_results) {
my $hits = ($#{$link_results{$setoflinks}} + 1) / ($#db_cols+1);
LINK: for ($i = 0; $i < $hits; $i++) {
$link_hits++;
if (($link_hits <= $highrange) && ($link_hits >= $lowrange)) {
%tmp = &array_to_hash ($i, @{$link_results{$setoflinks}});
$link_output{$setoflinks} .= &site_html_link (%tmp) . "\n";
}
}
}

# Go through the hash just built, and build the complete link output. Store in $link_results.
foreach $setoflinks (sort keys %link_output) {
$cat_clean = &build_clean ($setoflinks);
$title_linked = &build_linked_title ($setoflinks);
$link_results .= qq|<P>$title_linked\n|;
$link_results .= $link_output{$setoflinks};
}
# If we want to bold the search terms...
if ($search_bold) {
foreach $term (@search_terms) {
# This reg expression will do the trick, and doesn't bold things inside <> tags such as
# URL's.
$link_results =~ s,(<[^>]+>)|(\Q$term\E),defined($1) ? $1 : "<STRONG>$2</STRONG>",gie;
$category_results =~ s,(<[^>]+>)|(\Q$term\E),defined($1) ? $1 : "<STRONG>$2</STRONG>",gie;
}
}

# If we have to many hits, let's build the next toolbar, and return only the hits we want.
my ($next_hit, $prev_hit, $next_url, $left, $right, $lower, $upper, $i);

if ($link_hits > $maxhits) {

# Remove the nh= from the query string.
$next_url = $ENV{'QUERY_STRING'};
$next_url =~ s/\&nh=\d+//;
$next_hit = $nh + 1; $prev_hit = $nh - 1;

# Build the next hits toolbar. It seems really complicated as we have to do
# some number crunching to keep track of where we are on the toolbar, and so
# that the toolbar stays centred.

# First, set how many pages we have on the left and the right.
$left = $nh; $right = int($numhits/$maxhits) - $nh;
# Then work out what page number we can go above and below.
($left > 7) ? ($lower = $left - 7) : ($lower = 1);
($right > 7) ? ($upper = $nh + 7) : ($upper = int($link_hits/$maxhits) + 1);
# Finally, adjust those page numbers if we are near an endpoint.
(7 - $nh >= 0) and ($upper = $upper + (8 - $nh));
($nh > ($link_hits/$maxhits - 7)) and ($lower = $lower - ($nh - int($link_hits/$maxhits - 7) - 1));
$next = "";

# Then let's go through the pages and build the HTML.
($nh > 1) and ($next .= qq~<a href="$build_search_url?$next_url&nh=$prev_hit">[<<]</a> ~);
for ($i = 1; $i <= int($link_hits/$maxhits) + 1; $i++) {
if ($i < $lower) { $next .= " ... "; $i = ($lower-1); next; }
if ($i > $upper) { $next .= " ... "; last; }
($i == $nh) ?
($next .= qq~$i ~) :
($next .= qq~<a href="$build_search_url?$next_url&nh=$i">$i</a> ~);
(($i * $maxhits) >= $link_hits) and last; # Special case if we hit exact.
}
$next .= qq~<a href="$build_search_url?$next_url&nh=$next_hit">[>>]</a> ~ unless ($nh == $i);
}
# Print out the HTML results.
&site_html_search_results;
}

sub search {
# --------------------------------------------------------
# This routine does the actual search of the database.
#
my ($search_terms, $bool) = @_;
my ($regexp, @values, $grand_total, $match, $andmatch, $field, $or_match, %seen, $link, $tmp);

# Save the reg expressions to avoid rebuilding.
$or_match = $bool ne 'and';
if ($or_match) {
for (0 .. $#{$search_terms}) {
next if (length ${$search_terms}[$_] < 2); # Skip single letter words.
$tmp .= "m/\Q${$search_terms}[$_]\E/io ||";
}
}
else {
for (0 .. $#{$search_terms}) {
next if (length ${$search_terms}[$_] < 2); # Skip single letter words.
$tmp .= "m/\Q${$search_terms}[$_]\E/io &&";
}
}
chop ($tmp); chop ($tmp);

# We can also search by field names.
my @field_search;
for (0 .. $#db_cols) {
exists $in{$db_cols[$_]} and (push (@field_search, $_));
}
if (!$tmp and !@field_search) { return ("Please enter one or more keywords."); }
if ($tmp) { $regexp = eval "sub { $tmp }"; $@ and &cgierr ("Can't compile reg exp: $tmp! Reason: $@");}

# 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++;

# Check to see if the link matches.
$match = 0; $andmatch = 1;
if ($regexp) {
FIELD: foreach $field (@search_fields) {
$_ = $values[$field];
$or_match ?
($match = $match || &{$regexp}) :
($match = &{$regexp});
last FIELD if ($match);
}
}

# Check to see if the link matches any database fields. Only exact matches
# here.
if ($or_match || $match || !$regexp) {
FIELD: foreach $field (@field_search) {
if ($or_match) {
$match = $match || ($in{$db_cols[$field]} eq $values[$field]);
$match and last FIELD;
}
else {
$match = ($in{$db_cols[$field]} eq $values[$field]);
$match or last FIELD;
}
}
}
$andmatch = $andmatch && $match;

# If we have a hit, add it in!
if (($or_match && $match) or $andmatch) {
push (@{$link_results{$values[$db_category]}}, @values);
$numhits++; # We have a match!
}

# Check to see if the category matches.
if ($regexp and !$seen{$values[$db_category]}++) {
$match=0; $andmatch = 1;
$_ = $values[$db_category];
$or_match ?
($match = $match || &{$regexp}) :
($match = &{$regexp});
$andmatch = $andmatch && $match;

if (($or_match && $match) or $andmatch) {
$numcat++;
push (@category_results, $values[$db_category]);
}
}
}
close DB;

# Word is too common, don't try and sort it, can cause problems.
if (($numhits > 50) and (($grand_total * 0.75) < $numhits)) {
return "Search term is too common.";
} &log2;

# Sort the results using build_sorthit found in db.pl.
foreach $link ( keys %link_results ) {
@{$link_results{$link}} = &build_sorthit (@{$link_results{$link}});
}
@category_results = sort @category_results;
return "ok";
}

sub build_linked_title {
# --------------------------------------------------------
# A little different then the one found in nph-build.cgi as it also
# links up the last field as well.

my ($input) = shift;

my ($dir, $output, $path, $last);
foreach $dir ((split m!/!, $input)) {
$path .= "/$dir";
$dir = &build_clean ($dir);
$output .= qq|<A HREF="$build_root_url$path/">$dir</A>:|;
}
chop ($output);
return $output;
}

sub log2 {

open (KEYWORDS, ">>$kword_file_name") or &cgierr("Error in search. Cannot open keyword file.");
print KEYWORDS $in{'query'} . q|\|| . $ENV{'REMOTE_HOST'} . q|\|| . &get_date . q|\|| . &get_time . q|\|| . $numhits . q|\||;
close (KEYWORDS);

}

I run this through a perl script test, and it only gave a few minor errors - the formatting is fine;

Code:
Perl Said:

[Fri Jan 6 10:26:16 2006] GTTemp19761574: Name "main::search_bold" used only once: possible typo at test.pm line 131.
[Fri Jan 6 10:26:16 2006] GTTemp19761574: Name "main::db_use_flock" used only once: possible typo at test.pm line 213.
[Fri Jan 6 10:26:16 2006] GTTemp19761574: Name "main::kword_file_name" used only once: possible typo at test.pm line 304.
[Fri Jan 6 10:26:16 2006] GTTemp19761574: Name "main::build_root_url" used only once: possible typo at test.pm line 296.
[Fri Jan 6 10:26:16 2006] GTTemp19761574: Name "main::build_use_templates" used only once: possible typo at test.pm line 43.
[Fri Jan 6 10:26:16 2006] GTTemp19761574: Name "main::numcat" used only once: possible typo at test.pm line 265.
[Fri Jan 6 10:26:16 2006] GTTemp19761574: Name "main::search_fields" used only once: possible typo at test.pm line 224.
test.pm syntax OK

Its more than likely a VERY little typo/missing sub-routine, or similar.. hopefully fatalsToBrowser will help track that down :)

Hope that helps :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [LordStryfe] Search Word Mod? In reply to
Thanks for all of the feedback guys. I got it working again. Do have one question for you. The formatting for the keywords.txt. How do I format it correctly?

musichristian||27-Nov-1974|18:00:00|2
musichristian||26-Oct-1974|18:00:00|2
musichristian||16-Aug-1974|18:00:00|2
Quote Reply
Re: [LordStryfe] Search Word Mod? In reply to
What do you mean "correctly"? How do you want it? The output is determined by the code:

print KEYWORDS qq~$in{'query'}\|$ENV{'REMOTE_HOST'}\|&get_date\|&get_time\|$numhits\n~;

---
Bobsie and Andy,

Hey, good to know you're still alive! Are you slumming over here in Links2-land? Bobsie, good idea to simplify the code, I just copied it as I have it on file. Sure glad I saved mods as I found them!


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Search Word Mod? In reply to
The timing threw me off with the date being a bit off. I messaged all of the mods on here to see about a response because I didn't know when you would be on. Your kinda our un-official moderator.

Last edited by:

LordStryfe: Jan 6, 2006, 2:06 PM
Quote Reply
Re: [LordStryfe] Search Word Mod? In reply to
Ah, I overlooked the date and time... That's a bit odd, especially being different months, but all the same time...

Looking at mine (which I haven't done in a LONG time), it also has 14-16 April, 1974 and 19:00:00.Crazy

Not sure what's going on with that! You can remove the parts of the code that put in the date and time, or maybe one of the other guys knows what's goin' on. It's good to know the moderators are quick to respond! Sly


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Search Word Mod? In reply to
Hi, this is interesting because I implemented the Shepstalov Mod awhile ago and had purposely left out the Search Log section.

After implementing it today, I too found an issue with the date. Is there a fix for this or does someone know what causes it?

I also noticed that keywords.txt will log mutiple instances of the same search term. I've found references in the forum to a Mod called Keylogger, unfortunately it seems to be no longer available.

Is there a way for the Shepstalov Search Log to be modified so that it simply adds a count (similar to how it counts the amount of hits returned) for the amount of times it is searched instead of continually adding the same words to keywords.txt for each search?

Any suggestions or ideas would be much appreciated. Smile
Quote Reply
Re: [Thene] Search Word Mod? In reply to
I didn't try it, but maybe the problem is in using a subroutine call instead of a variable. Try this:

Code:

sub log2 {
my $date = &get_date;
my $time = &get_time;

open (KEYWORDS, ">>$kword_file_name") or &cgierr("Error in search. Cannot open keyword file.");
print KEYWORDS $in{'query'} . q|\|| . $ENV{'REMOTE_HOST'} . q|\|| . $date . q|\|| . $time . q|\|| . $numhits . q|\||;
close (KEYWORDS);

}




I'm sure the count could be fixed like you want, too, but would involve a bit more hacking...

Also, I think most firewalls prevent the 'remote host' part from showing anything, so should be removed.

----

Or to use the cleaner code:
Code:
print KEYWORDS qq~$in{'query'}\|$ENV{'REMOTE_HOST'}\|$date\|$time\|$numhits\n~;


Leonard
aka PerlFlunkie

Last edited by:

PerlFlunkie: Feb 18, 2006, 11:06 AM
Quote Reply
Re: [PerlFlunkie] Search Word Mod? In reply to
Thanks so much for your reply. I actually found that both

Quote:
sub log2 {
my $date = &get_date;
my $time = &get_time;

open (KEYWORDS, ">>$kword_file_name") or &cgierr("Error in search. Cannot open keyword file.");
print KEYWORDS $in{'query'} . q|\|| . $ENV{'REMOTE_HOST'} . q|\|| . $date . q|\|| . $time . q|\|| . $numhits . q|\||;
close (KEYWORDS);

}

and

Quote:
sub log2 {
my $date = &get_date;
my $time = &get_time;

open (KEYWORDS, ">>$kword_file_name") or &cgierr("Error in search. Cannot open keyword file.");
print KEYWORDS qq~$in{'query'}\|$ENV{'REMOTE_HOST'}\|$date\|$time\|$numhits\n~;
close (KEYWORDS);

}
[/code]
didn't work to solve the incorrect time and date.

I was a little tired last night when I posted so as I re-read through the thread I also tried

Quote:

sub log2 {
open (KEYWORDS, ">>$kword_file_name") or &cgierr("Error in search. Cannot open keyword file.");
print KEYWORDS qq~$in{'query'}\|$ENV{'REMOTE_HOST'}\|&get_date\|&get_time\|$numhits\n~;
close (KEYWORDS);
}

which I found in Bobsie's Post (Post #6) (this only produced search term|&get_date|&get_time|)

and this

Quote:
sub log2 {

open (KEYWORDS, ">>$kword_file_name") or &cgierr("Error in search. Cannot open keyword file.");
print KEYWORDS $in{'query'} . q|\|| . $ENV{'REMOTE_HOST'} . q|\|| . &get_date . q|\|| . &get_time . q|\|| . $numhits . q|\||;
close (KEYWORDS);

}

from Andy's Post (Post #7) which incidentally didn't work either. This one still showed incorrect date and time.

However using Andy's sub log2 and your addition of the variables it worked, however all the search terms logged end up on one line.

So I've ended using the Shepstalov Mod including your help and it works beautifully. Thanks for your help, I'll be looking into the count for logging same search terms soon.


sub log2 {
my $date = &get_date;
my $time = &get_time;

open (KEYWORDS, ">>$kword_file_name") or &cgierr("Error in search. Cannot open keyword file.");
print KEYWORDS $in{'query'};
print KEYWORDS "\|";
print KEYWORDS $ENV{'REMOTE_HOST'};
print KEYWORDS "\|";
print KEYWORDS &get_date;
print KEYWORDS "\|";
print KEYWORDS &get_time;
print KEYWORDS "\|";
print KEYWORDS $numhits;
print KEYWORDS "\n";
close (KEYWORDS);
}

Quote Reply
Re: [Thene] Search Word Mod? In reply to
Thanks for keeping us posted! Andy's code is missing the new-line character:


Code:

sub log2 {
my $date = &get_date;
my $time = &get_time;
open (KEYWORDS, ">>$kword_file_name") or &cgierr("Error in search. Cannot open keyword file.");
print KEYWORDS $in{'query'} . q|\|| . $ENV{'REMOTE_HOST'} . q|\|| . $date . q|\|| . $time . q|\|| . $numhits . q|\n|;
close (KEYWORDS);

}


or a bit cleaner...

Code:

sub log2 {
my $date = &get_date;
my $time = &get_time;
open (KEYWORDS, ">>$kword_file_name") or &cgierr("Error in search. Cannot open keyword file.");
print KEYWORDS $in{'query'} . "|" . $ENV{'REMOTE_HOST'} . "|" . $date . "|" . $time . "|" . $numhits . "\n";
close (KEYWORDS);

}


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Search Word Mod? In reply to
In Reply To:
Thanks for keeping us posted! Andy's code is missing the new-line character:


Code:

sub log2 {
my $date = &get_date;
my $time = &get_time;
open (KEYWORDS, ">>$kword_file_name") or &cgierr("Error in search. Cannot open keyword file.");
print KEYWORDS $in{'query'} . q|\|| . $ENV{'REMOTE_HOST'} . q|\|| . $date . q|\|| . $time . q|\|| . $numhits . q|\n|;
close (KEYWORDS);

}

Unforunately this one doesn't work. It produces the result \nsearch term||20-Apr-1974|10:00:00|1. So the date is still incorrect and all results are on the one line with \n appearing.

or a bit cleaner...

Code:

sub log2 {
my $date = &get_date;
my $time = &get_time;
open (KEYWORDS, ">>$kword_file_name") or &cgierr("Error in search. Cannot open keyword file.");
print KEYWORDS $in{'query'} . "|" . $ENV{'REMOTE_HOST'} . "|" . $date . "|" . $time . "|" . $numhits . "\n";
close (KEYWORDS);

}

This one pushes to the next line, but the date and time are still wrong.


I found for it to work for me it needs to have $date and $time replaced with &get_date and &get_time for these to show up with the correct date and time.

Code:
sub log2 {
my $date = &get_date;
my $time = &get_time;
open (KEYWORDS, ">>$kword_file_name") or &cgierr("Error in search. Cannot open keyword file.");
print KEYWORDS $in{'query'} . "|" . $ENV{'REMOTE_HOST'} . "|" . &get_date . "|" . &get_time . "|" . $numhits . "\n";
close (KEYWORDS);

}
Thanks again. Cheers Smile