Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.
.htpasswd & .htaccess user log
Is it possible to log anybody that logs in the password protected area (by .htpasswd) of my website, and store the info in some file located on the server?
Like :
log.txt
Cynoxx logged at 9:00 AM. IP: 127.0.0.1 etc..etc..
Is that possible?
EDIT : If it is, how :P?
Put the following code in the index.php of the protected dir:
<?
$ip=$_SERVER['REMOTE_ADDR'];
$file="log.txt";
$fp = fopen ("$file", "a+");
$time= date(' l ds &*92;of F Y h:i:s A') // This will output the date in the format: Friday 26th of May 2006 01:59:25 PM ;
$content= "$ip logged in at $time &*92;n";
fwrite($fp, $content);
fclose($fp);
?>
NOTE: The &*92; is supposed to be a backslash