home *** CD-ROM | disk | FTP | other *** search
- #!/usr/bin/perl
-
- $date_command = "/bin/date";
- $date = `$date_command +"%B %d, %Y"`; chop($date);
-
- $count_file = "count.txt";
- open(COUNT,"$count_file") || die "$!\n";
- flock COUNT,2;
- $count = <COUNT>;
- close(COUNT);
- if ($count =~ /\n$/) {
- chop($count);
- }
-
- $count++;
-
- open(COUNT,">$count_file") || die "$!\n";
- print COUNT "$count";
- close(COUNT);
-
- open(LOG,">>log.txt") || die "$!\n";
- print LOG "$date:$ENV{'REMOTE_HOST'}:$ENV{'REMOTE_ADDR'}:$ENV{'HTTP_REFERER'}\n";
- close(LOG);
-
- print "Content-Type: text/html \n\n";
- print "$count";
-
-