<?php
// test_debug.php
require_once __DIR__ . '/../db.php';
header('Content-Type: application/json');

$method = $_SERVER['REQUEST_METHOD'];
$post_data = $_POST;
$raw_input = file_get_contents('php://input');
$action = $_POST['action'] ?? 'none';

echo json_encode([
    'method' => $method,
    'post_data' => $post_data,
    'raw_input' => $raw_input,
    'action' => $action,
    'server_time' => date('Y-m-d H:i:s')
]);
?>