Initial commit: существующий сайт + конфигурация разработки
Some checks failed
Deploy to Production / deploy (push) Failing after 4s

This commit is contained in:
2026-01-10 22:23:00 +03:00
parent 28b50d28c1
commit 5b11e61c8e
16 changed files with 1339 additions and 0 deletions

30
html/api/counter.php Normal file
View File

@@ -0,0 +1,30 @@
<?php
// Простой обработчик счетчика
header('Content-Type: application/json');
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: POST, GET');
header('Access-Control-Allow-Headers: Content-Type');
$counterFile = __DIR__ . '/counter.txt';
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
// Получаем данные от JavaScript
$data = json_decode(file_get_contents('php://input'), true);
$count = isset($data['count']) ? intval($data['count']) : 1;
// Записываем в файл
file_put_contents($counterFile, $count);
echo json_encode(['status' => 'success', 'count' => $count]);
} elseif ($_SERVER['REQUEST_METHOD'] === 'GET') {
// Возвращаем текущее значение
if (file_exists($counterFile)) {
$count = file_get_contents($counterFile);
} else {
$count = 0;
}
echo json_encode(['count' => intval($count)]);
}
?>

0
html/api/counter.txt Normal file
View File