1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
<?php function _log($action, $username) { global $DATA_DIR; $ip = $_SERVER['REMOTE_ADDR']; $time = date("D M jS Y G:i", time()); $fp = fopen($DATA_DIR . "/admin.log", "a"); fprintf($fp, "%s - %s: User %s from %s\n", $time, $action, $username, $ip); fclose($fp); } ?>