psniquiz/dRec.php

28 lines
806 B
PHP
Raw Permalink Normal View History

2024-07-19 19:18:16 +03:00
<?php
header("Content-Type: text/plain");
try {
date_default_timezone_set("Europe/Moscow");
echo date("d.m.Y H:i:s");
$data = json_decode(file_get_contents("php://input"));
if (json_last_error() != JSON_ERROR_NONE) $data = file_get_contents("php://input");
if (isset($data->saveMark)) {
2024-09-26 21:44:21 +03:00
if ($data->type == "videos") { $savePath = "./vlist.ejd"; }
if ($data->type == "games") { $savePath = "./glist.ejd"; }
if ($data->type == "curgame") { $savePath = "./curgame.ejd"; }
2024-07-19 19:18:16 +03:00
if ($savePath != "") {
file_put_contents($savePath, $data->data);
2024-09-26 21:44:21 +03:00
file_put_contents($savePath . ".sm", json_encode($data->saveMark));
2024-07-19 19:18:16 +03:00
}
} else {
if ((strlen($data) > 10) && (strlen($data) < 500000)) file_put_contents("./data", $data);
}
}
catch(Throwable $ex) {
echo "ЕГГОГ";
}
?>