Use this PHP Function to log data as needed in your programs
function logdatstuff($logit) { $SESID = session_id(); $logdate = date('d-m-Y.H.i.s'); $log_filename = "Logfilename.$SESID.log"; chdir('/var/log/'); if (!file_exists($log_filename)) { $handler = fopen($log_filename, 'a'); $logdata = "============ New Log Entry ==========\n"; fwrite($handler, $logdata); fclose($handler); } $handler = fopen($log_filename, 'a'); $logit0 = "$logdate:$logit\n"; fwrite($handler, $logit0); }Call the function with this code:
$logdata = "Log Function Active";logdatstuff($logdata);