Zubrag.com
May 21, 2012, 12:40:48 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: Log file with username added  (Read 2647 times)
miniop
Newbie
*
Posts: 3


« on: March 14, 2008, 07:30:06 am »

Hi i am using the Password Protect Advanced so i have a php page that says welcome $login . $login is the username.

So is it possible to add a variable in the smart file download here :

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

Where the output of the log file will add also the username of the logged person that is trying to d/l the file ?

Thank you

Logged
miniop
Newbie
*
Posts: 3


« Reply #1 on: March 14, 2008, 09:21:15 am »

Done :

ob_start();
include 'login.php';
ob_end_clean();

// 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."  ".$login."\n");
  @fclose($f);


The output of downloads.log will be like this :

03.14.2008 5:15pm  11.11.11.11  xxxxx.zip  user1
03.14.2008 5:16pm  22.22.61.61  aaaaa.zip user2
Logged
Pages: [1]
  Print  
 
Jump to:  

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