RE: [PHP] Help with file not writing
| From: | Joey | Date: | Wed, 26 Jan 2005 05:40:11 +0000 |
| Subject: | RE: [PHP] Help with file not writing | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-207353@lists.php.net to get a copy of this message | ||
That was it Bret, thanks for pointing out my blindess...
Joey
-----Original Message-----
From: Bret Hughes [mailto:bhughes@elevating.com]
Sent: Wednesday, January 26, 2005 12:34 AM
To: php general list
Subject: Re: [PHP] Help with file not writing
On Tue, 2005-01-25 at 07:53, Joey wrote:
> I'm not too good with classes, in the below class I can get the hit
> counter to write to the hit counter file, but I can't get it to write
> the log file, I know security is done correctly on the file because
> it's the same as the counter log file, but I can't figure out why the
> other file isn't being written to.
> Also while the IP address works within the code prior to calling the
> class
>
> function writeLog()
> {
> $ip_address=$REMOTE_ADDR;
> $date_stamp=date("F j, Y, g:i a");
> $log_entry=$date_stamp . " : " . $ip_address . "\n" ;
> echo "TEST-> " . $log_entry ;
> $log = fopen($this->log_file,"w+");
> fputs($log,$this->$log_entry );
> fclose($log);
>
you set $log_entry but write $this->log_entry which does not exist.
try fputs($log,$log_entry );
HTH
Bret
--
PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php