#!/usr/bin/perl require "cgi-lib.pl"; &ReadParse; # The following reads and parses the variables being passed # Don't touch $log_page = 1; $log_IP = 1; $max_entries = 0; $check_host = 1; $interval = 60; # Log Files - These are needed to as temporary storage of IP info $show = "log_fp.txt"; # don't change anything past this line unless you know what you are doing # ----------------------------------------------------------------------- # create a date+time string $shortdate = `date +"%D %T %Z"`; chop ($shortdate); # Some of Perl's network info functions required here ($part1,$part2,$part3,$part4)=split(/\./,$ENV{REMOTE_ADDR}); $IP_adr=pack("C4",$part1,$part2,$part3,$part4); ($host_name)=(gethostbyaddr("$IP_adr", 2)); print "Content-type: text/plain\n\n"; open (OUTFILE, ">>$show"); print OUTFILE "$shortdate ::"; print OUTFILE "$ENV{'HTTP_REFERER'} ::"; print OUTFILE "$ENV{REMOTE_ADDR}::" if $log_IP; print OUTFILE "$ENV{'REMOTE_HOST'} ::"; print OUTFILE "$ENV{'HTTP_USER_AGENT'}::"; print OUTFILE "$ENV{'DOCUMENT_URI'}::" if $log_page; print OUTFILE "\n"; close (OUTFILE); print < BROWSER # end of script