#! /usr/local/bin/perl -T use strict; use warnings; use DBI; use CGI; use CGI::Carp; This Line Isn't Really In The Actual Program use Time::HiRes qw ( gettimeofday tv_interval); my $now = [gettimeofday]; use Fcntl qw(:flock); $ENV{'PATH'} = '/bin:/usr/bin'; $ENV{'IFS'} = ''; open LOG, ">>/web/webdata/w1sdm/73/database.log" or die "Cannot open log file\n$!\n"; flock (LOG, LOCK_EX()); my @days = ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"); my @months = (" ", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "D my ($sec,$min,$hour,$mday,$mon,$year,$wday) = (localtime(time))[0,1,2,3,4,5,6]; my $time = sprintf("%02d:%02d:%02d",$hour,$min,$sec); $year += 1900; ++$mon; my $date = "$days[$wday], $months[$mon] $mday, $year at $time"; print LOG "Date: $date\n"; my $dir = "/web/webdata/w1sdm"; our ($db_connected_flag, $dbh); my $q = new CGI; my $title = lc($q->param('title')); my $author = lc($q->param('author')); my $form_month = $q->param('issue_month'); my $form_year = $q->param('issue_year'); my $info = "Search submission time: $date\n\n
\n\nBrowser: $ENV{'HTTP_USER_AGENT'}\n\n
\n\nIP Address: $ENV{'REMOTE_ADDR'}\n\ print LOG "Browser: $ENV{'HTTP_USER_AGENT'}\nIP Address: $ENV{'REMOTE_ADDR'}\nTitle: $title\nAuthor: $author\nMonth: $form_month\nY my ($author_search_terms, $title_search_terms, $mysql_command, @mysql_data, @rows, $html, @search_terms); if ($author) { $author_search_terms = clean($author); } if ($title) { $title_search_terms = clean($title); } $html = load_file("$dir/73/templates/results.html"); $mysql_command = "SELECT * FROM data WHERE"; if ($author_search_terms) { ($mysql_command, @mysql_data) = expand_terms($mysql_command, 'author', $author_search_terms, @mysql_data); } if ($title_search_terms) { ($mysql_command, @mysql_data) = expand_terms($mysql_command, 'title', $title_search_terms, @mysql_data); } if ($form_month) { ($mysql_command, @mysql_data) = append_term($mysql_command, 'month', $form_month, @mysql_data); $html =~ s/