Zubrag.com
May 21, 2012, 01:18:27 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Simple Logfile Error  (Read 1823 times)
naders
Newbie
*
Posts: 1


« on: December 17, 2008, 06:27:11 pm »

I set up the downloader, very nice and easy script. Thanks again zub.

However when someone downloads my file it is stored in the logs without a new line. It looks like this...

downloads.log
Code:
12.18.2008 12:14am  IP.ADDR  FILE.ZIP12.18.2008 12.18.2008 12:14am  IP.ADDR  FILE.ZIP12.18.2008 12:14am  IP.ADDR  FILE.ZIP

But with no new line whatsoever just a single line all jumbled together.

The log code is as such:

Code:
// log downloads
if (!LOG_DOWNLOADS) die();

$f = @fopen(LOG_FILE, 'a+');
if ($f) {
  @fputs($f, date("m.d.Y g:ia")."  ".$_SERVER['REMOTE_ADDR']."  ".$fname."\n");
  @fclose($f);
}

I know it has to do with the \n but I have no PHP knowledge so if anyone could make it log to a new line each time or is it just me?

Thanks again! Wink

Logged
recoding
Global Moderator
Jr. Member
*****
Posts: 71


WWW
« Reply #1 on: February 27, 2009, 08:32:02 pm »

Hmm, if you are viewing this downloads.log in a web browser, change "\n" to "<br />\n"

Even though you have a \n new line set, that's only in the source, for a newline to work in HTML, you need the <br />
Logged

Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC