"errors out via the web" What error message do you get? Is there anything in
the Apache error logs that's relevant?

Does the web server account have write access to the ipaccess.log file?

John

-----Original Message-----
From: Michael Pratt [mailto:[EMAIL PROTECTED]]
Sent: 22 January 2002 11:44
To: [EMAIL PROTECTED]
Subject: What is wrong with this?


I am trying to log the users IP via the web and nothing happens the date
nore the ip get there. Also if I put the append to the open statement I get
an error via the web also.  This is the code. I got it to show up via the
web but it never gets to the file.  Is there something I am missing?

#!/usr/bin/perl

$logfile = '/usr/local/apache/logs/ipaccess.log';
$date = scalar localtime;

open(IPLOG, $logfile) || die "Cannot open $logfile";
$ip = $ENV{'REMOTE_ADDR'};
print IPLOG $date;
print IPLOG "$ip";
close IPLOG;


If I do it this way it errors out via the web:

#!/usr/bin/perl

$logfile = '/usr/local/apache/logs/ipaccess.log';
$date = scalar localtime;

open(IPLOG, ">>$logfile") || die "Cannot open $logfile";
$ip = $ENV{'REMOTE_ADDR'};
print IPLOG $date;
print IPLOG "$ip";
close IPLOG;


Mike




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--------------------------Confidentiality--------------------------.
This E-mail is confidential.  It should not be read, copied, disclosed or
used by any person other than the intended recipient.  Unauthorised use,
disclosure or copying by whatever medium is strictly prohibited and may be
unlawful.  If you have received this E-mail in error please contact the
sender immediately and delete the E-mail from your system.



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to