Вы сказали:
Получится собрать все POST запросы в лог файл Когда был запрос и какие запросы входили POST
И его чтение считывать файл и в таблице красиво выводить
<?php
// error_reporting(E_STRICT | E_ALL);
// ini_set("display_errors",-1);
// Получаем запрошенный URI и удаляем параметры запроса
$requestUri = explode('?', $_SERVER['REQUEST_URI'])[0];
$requestUri = trim($requestUri, '/');
// Разбиваем URI на сегменты
$segments = explode('/', $requestUri);
// Проверяем минимальную длину и начало пути
if (count($segments) < 3 || $segments[0] !== 'kursy') {
// http_response_code(404);
// exit('Page not found');
}
// Формируем ключ для switch (первые 3 сегмента)
$routeKey = implode('/', array_slice($segments, 0, 3));
$remaining = implode('/', array_slice($segments, 3));
// Обрабатываем маршруты
switch ($routeKey) {
case 'kursy/graf-design/profperepodgotovka':
$basePath = '/land/web_diz';
break;
case 'kursy/design/shkola-dizayna-interyera':
$basePath = '/land/di';
break;
case 'kursy/psihologiya/profperepodgotovka':
$basePath = '/land/land_4';
break;
case 'kursy/graf-design/kurs-graf-dizaina':
$basePath = '/land/land_6';
break;
case 'kursy/design/interier':
$basePath = '/land/land_5';
break;
// default:
// http_response_code(404);
// exit('Invalid route');
}
// Формируем путь к файлу
if(isset($remaining) && isset($basePath)){
$targetFile = $remaining
? "{$basePath}/{$remaining}.php"
: "{$basePath}/index.php";
// Проверяем существование файла
$fullPath = $_SERVER['DOCUMENT_ROOT'] . $targetFile;
if (file_exists($fullPath)) {
//http_response_code(404);
include $fullPath;
exit;
//exit('File not found');
}
}
// Включаем целевой файл
/**
* @file
* The PHP page that serves all page requests on a Drupal installation.
*
* All Drupal code is released under the GNU General Public License.
* See COPYRIGHT.txt and LICENSE.txt files in the "core" directory.
*/
use Drupal\Core\DrupalKernel;
use Symfony\Component\HttpFoundation\Request;
$autoloader = require_once 'autoload.php';
$kernel = new DrupalKernel('prod', $autoloader);
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);