Hi Sure,
FYI I have saved the files in a zip file attached to this post
Code in html page before closing body tag
<?php
require_once 'Class.Logging.php';
$msg = "this is another message ";
$from = $_SERVER['SCRIPT_NAME'] ;
$remaddr = $_SERVER['REMOTE_ADDR'];
$log = new log();
$log->userIP($remaddr , $msg , $from);
?>
Code In Logging File
//file Class.Logging.php
Class log {
const USER_ERROR_DIR = "Logging/Site_User_errors.log";
/*
Record IP and optionally a message ...
*/
public function userIP($ip, $msg="No msg", $from="No File-info") {
$date = date('d.m.Y h:i:s');
$log = " Date: ".$date." |User's IP : ".$ip." |Message : ".$msg." |File : ".$from."\n";
error_log($log, 3, self::USER_ERROR_DIR);
}
/*
Record only a message ...
*/
public function msg($msg) {
$date = date('d.m.Y h:i:s');
$log = " Date: ".$date." |Message : ".$msg."\n";
error_log($log, 3, self::USER_ERROR_DIR);
}
}
regards Nick