DigitalKitty has asked for the wisdom of the Perl Monks concerning the following question:
#!c:\perl\perl.exe use strict; use warnings; use CGI qw( fatalsToBrowser ); use CGI qw ( :standard ); use Fcntl qw( :flock ); my @vars = qw( REMOTE_ADDR REMOTE_PORT REQUEST_URI QUERY_STRING ); my @stuff = @ENV{ @vars }; my $info = join( " | ", @stuff ); open( FILE, "+>>log.txt" ) or die( "Could not open log.txt: $!" ); flock( FILE, LOCK_EX ) or die( "Could not get exclusive lock: $!" ); print( FILE "$info\n\n" ); flock( FILE, LOCK_UN ) or die( "Could not unlock file: $!" ); close( FILE ); if ( $stuff[3] ne "" ) { print( header( -Refresh=> '5; URL=http://www.google.com' ) ); print( start_html( "log.txt" ) ); print( h1( "Welcome to my web site , $stuff[3]!\n" ) ); print( p( i( "You will now be redirected to our home page." ) ) ); } else { print( header() ); print( start_html( "log.txt" ) ); print( h1( "Please add a \"?\" and your name to the URL.\n" ) ); } print( end_html() );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problem with CGI script.
by december (Pilgrim) on Aug 04, 2002 at 03:36 UTC | |
by ajt (Prior) on Aug 04, 2002 at 11:10 UTC | |
|
Re: Problem with CGI script.
by graff (Chancellor) on Aug 04, 2002 at 03:17 UTC | |
|
Re: Problem with CGI script.
by DigitalKitty (Parson) on Aug 04, 2002 at 04:40 UTC | |
by graff (Chancellor) on Aug 04, 2002 at 07:53 UTC | |
|
Re: Problem with CGI script.
by zentara (Cardinal) on Aug 04, 2002 at 15:42 UTC | |
|
Re: Problem with CGI script.
by Anonymous Monk on Aug 04, 2002 at 16:07 UTC |