core/api/php/log.php

13 lines
469 B
PHP
Raw Normal View History

2022-12-11 13:55:49 +05:00
<?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);
}
}
?>