%PDF- %PDF-
| Direktori : /data/www_bck/varak.net_bck/csp.varak.net/ |
| Current File : //data/www_bck/varak.net_bck/csp.varak.net/report.php |
<?php
include "/www/varak.net/losik.varak.net/lib/dibi.phar";
http_response_code(204); // HTTP 204 No Content
$current_domain = preg_replace('/www\./i', '', $_SERVER['SERVER_NAME']);
$json_data = file_get_contents('php://input');
// We pretty print the JSON before adding it to the log file
if ($json_data = json_decode($json_data))
{
//print_r($json_data);
$jd = json_encode($json_data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
dibi::connect(array(
'driver' => 'mysql',
'host' => 'localhost',
'username' => 'csp',
'password' => 'ncaWhteA4PBPZt78',
'database' => 'csp',
'charset' => 'utf8',
'profiler' => [
'run' => TRUE,
'file' => __DIR__ . '/log/log-' . date('Y-m-d') . '.txt',
],
));
$data = array(
"timestamp" => time(),
"domain" => $_SERVER['HTTP_ORIGIN'],
"data" => $jd,
"user_agent" => $_SERVER["HTTP_USER_AGENT"],
"address" => $_SERVER["REMOTE_ADDR"],
"method" => $_SERVER["REQUEST_METHOD"]
);
dibi::query("INSERT INTO [raw_data]", $data);
file_put_contents( __DIR__ . "/raw/" . uniqid("raw_", true) . ".txt", $jd);
}
file_put_contents("server.txt", print_r($_SERVER, true));