#!/usr/bin/perl
##
#
# Chat Logger Searcher
# 2003 Creature From Hell
#
# Set the file locations

# Required to display error messages
print "Content-type: text/html\n\n";
print "<HTML><BODY>";
print "<TITLE>Logfile Search Results</TITLE>";

$log_file = "NAME OF LOGFILE";

# what does the user want to find?
($dump,$s_search) = split(/=|&/,$ENV{'QUERY_STRING'});


if (open(HEADER_FILE, "$log_file"))
	{
		while (<HEADER_FILE>)
		{
			$inline = $_;
			$test = $s_search;
			if (/$test/g)
			{
				print "<P>$_</P>\n";
				# let's not make the search case-sensitive, ok?
			}
		}
}

# end of header code
# Required to display error messages
print "</BODY></HTML>";

