amalgama has asked for the wisdom of the Perl Monks concerning the following question:
#! /usr/local/bin/perl # logger.cgi # version 1.0 # # Create a file called main.log. Must have write permissions # set to main.log $mainlog = "main.log"; $shortdate = `date +"%D %T %Z"`; chop ($shortdate); print "Content-type: text/plain\n\n "; open (MAINLOG, ">>$mainlog"); print MAINLOG "Time: $shortdate\n"; print MAINLOG "User: $ENV{'REMOTE_IDENT'}\n"; print MAINLOG "Host: $ENV{'REMOTE_HOST'}\n"; print MAINLOG "Addr: $ENV{'REMOTE_ADDR'}\n"; print MAINLOG "With: $ENV{'HTTP_USER_AGENT'}\n"; print MAINLOG "Page: $ENV{'DOCUMENT_URI'}\n"; print MAINLOG "From: $ENV{'HTTP_REFERER'}\n\n"; close (MAINLOG); exit;
Edit by castaway - Font tags removed as they muck with themes.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: logger.cgi script - implementing one feature
by sh1tn (Priest) on May 10, 2005 at 23:30 UTC | |
|
Re: logger.cgi script - implementing one feature
by polettix (Vicar) on May 11, 2005 at 00:03 UTC | |
|
Re: logger.cgi script - implementing one feature
by ikegami (Patriarch) on May 10, 2005 at 19:46 UTC | |
by amalgama (Initiate) on May 11, 2005 at 10:01 UTC |