p006/api/php/log.php

13 lines
469 B
PHP
Executable File

<?php
class save_log{
var $file_name;
function print_log( $txt ) {
$file_name=$this->file_name;
$file_name = $_SERVER['DOCUMENT_ROOT'] . '/log/' . $file_name . '.txt';
$fileopen=fopen($file_name, 'a+');
$write=@date('d') . '.' . @date('m') . '.' . @date('Y') . ' ' . @date('G') . ':' . @date('i') . ':' . @date('s') . ' ' . $txt . ' -> ' . $_SERVER['HTTP_USER_AGENT'] . ' -> ' . USER_IP . "\r\n";
fwrite($fileopen,$write);
fclose($fileopen);
}
}
?>