View Single Post
Old 11-12-2003, 07:47 PM  
some_idiot
Confirmed User
 
Join Date: May 2002
Location: Doesn't matter, I'm not buying you another pint!
Posts: 1,511
How many of you guys are going to ask for this today???
You gotta learn to do a quick search or pick up a basic CGI
book. ...Here is perl.

Without logging:

#!/usr/bin/perl

$URL = $ENV{QUERY_STRING};
print "Location: $URL\n\n";


With logging:

#!/usr/bin/perl

$URL = $ENV{QUERY_STRING};
open (LOG,'>>/usr/local/www/cgi-bin/reflog.txt');
print LOG "$ENV{'REMOTE_ADDR'} $ENV{'REMOTE_HOST'} -> $URL\n";
close (LOG);
print "Location: $URL\n\n";

If you've got a wacky client (browser) you may have to send the header.
__________________

This AVS pays my mortgage!
some_idiot is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote