#!/usr/bin/perl # ~~~~~~~~~ update to your environment(1/3) # reflog.pl: Reference Log script # ver.1.00 1996/10/06 # Copyright (c)1996 GOMASUKE # Orange Internet Service USERS, Japan $dat = $ENV{'QUERY_STRING'}; $log_file = "/home/foo/log/$dat\.txt"; # ~~~~~~~~~~~~~ update to your environment(2/3) $gif_file = "/home/foo/gif/$dat\.gif"; # ~~~~~~~~~~~~~ update to your environment(3/3) @week = ("Sun","Mon","Tue","Wed","Thu","Fri","Sat"); ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdat) = localtime(time); $year += 1900; #VALID THRU 12/2037 $mon++; $date = sprintf("%4d/%02d/%02d %3s %02d:%02d:%02d", $year,$mon,$mday,$week[$wday],$hour,$min,$sec); $rh = $ENV{'REMOTE_HOST'}; if ($rh eq "") { $rh = $ENV{'REMOTE_ADDR'}; } $ua = $ENV{'HTTP_USER_AGENT'}; $ua =~ s/Mozilla/Netscape/g; if (-e $log_file) { open(LG,">>$log_file"); print LG "$date $rh $ua\n"; close(LG); } print "Content-type: image/gif\n\n"; open(GF,"<$gif_file"); print (); close(GF); exit;