View Single Post
Old 11-12-2003, 07:51 PM  
Mr Pheer
Top Rated CEO
 
Mr Pheer's Avatar
 
Industry Role:
Join Date: Dec 2002
Location: Las Vegas
Posts: 21,869
Quote:
Originally posted by some_idiot
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.
well that would be nice if i only wanted to redirect to one URL
__________________
Mr Pheer is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote