Jesse Smith has asked for the wisdom of the Perl Monks concerning the following question:
if ( THERE IS A $ENV{'HTTP_REFERER'} ) { $shortdate = `date +"%D %T %Z"`; chop ($shortdate); open (DATABASE,">>$database"); print DATABASE "$ENV{'REMOTE_ADDR'} - $shortdate - $ENV{'HTTP_ +USER_AGENT'} - <A HREF=\"http://$ENV{'HTTP_HOST'}$ENV{'REQUEST_URI'}\ +">http://$ENV{'HTTP_HOST'}$ENV{'REQUEST_URI'}</a> - <A HREF=\"$ENV{'H +TTP_REFERER'}\">$ENV{'HTTP_REFERER'}</a>\n"; close(DATABASE); } else{ $shortdate = `date +"%D %T %Z"`; chop ($shortdate); open (DATABASE2,">>$DATABASE2"); print DATABASE2 "$ENV{'REMOTE_ADDR'} - $shortdate - $ENV{'HTTP +_USER_AGENT'} - <A HREF=\"http://$ENV{'HTTP_HOST'}$ENV{'REQUEST_URI'} +\">http://$ENV{'HTTP_HOST'}$ENV{'REQUEST_URI'}</a> - NO HTTP_REFERER\ +n"; close(DATABASE2); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: if statement based on HTTP_REFERER
by Perlbotics (Archbishop) on Apr 09, 2015 at 16:56 UTC | |
|
Re: if statement based on HTTP_REFERER
by MidLifeXis (Monsignor) on Apr 09, 2015 at 17:11 UTC | |
|
Re: if statement based on HTTP_REFERRER
by Athanasius (Archbishop) on Apr 09, 2015 at 17:18 UTC |