virt2/api/php/log.php

13 lines
457 B
PHP
Raw Permalink Normal View History

<?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);
}
}
?>