Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Perl Beginners > RE: log missing...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 4 Topic 11058 of 11509
Post > Topic >>

RE: log missing images

by steve.hildreth@[EMAIL PROTECTED] (Steve Hildreth) May 12, 2008 at 12:15 PM

Of course, here it is...very simple.

#!/usr/local/bin/perl

# This script is used to log the referring URL in the event that a link
on an LAUSD is invalid

#Append referring URL to log file
open(LIST,">>/www-logs/error_file.txt");

#Capture referring URL
$_ =3D $ENV{'HTTP_REFERER'};

#Determine if originating page belongs to LAUSD
if(!/notebook.lausd.net|.gif|.css|aw:|google.com|myspace.com|.gif|.jpg/)
{
     print LIST "$_\n";
}
close (LIST);

#Redirect user to standard error page
print "Content-type: text/html\n\n";
print "<meta HTTP-EQUIV=3D\"Refresh\"
CONTENT=3D\"0;URL=3Dhttp://www.lausd.net/error.html\">";

Thanks,


Steve
-----------------------------------
Steve Hildreth
Office: 213-241-1691
Cell: 213-215-8195
steve.hildreth@[EMAIL PROTECTED]
 Message-----
From: Gunnar Hjalmarsson [mailto:noreply@[EMAIL PROTECTED]
 Monday, May 12, 2008 12:13 PM
To: beginners@[EMAIL PROTECTED]
 Re: log missing images

Hildreth, Steve wrote:
> What I am looking for is a parameter that I can add to my PERL script=20
> that will specify the file call that resulted in the log entry.

How about showing us the Perl (not PERL) script you have so far?

--=20
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

--=20
To unsubscribe, e-mail: beginners-unsubscribe@[EMAIL PROTECTED]
 additional commands, e-mail: beginners-help@[EMAIL PROTECTED]

 




 4 Posts in Topic:
log missing images
steve.hildreth@[EMAIL PRO  2008-05-12 11:41:57 
Re: log missing images
noreply@[EMAIL PROTECTED]  2008-05-12 21:12:57 
RE: log missing images
steve.hildreth@[EMAIL PRO  2008-05-12 12:15:03 
Re: log missing images
noreply@[EMAIL PROTECTED]  2008-05-12 22:35:48 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Jul 23 21:02:43 CDT 2008.