2026-03-09 07:12:13 +01:00

20 lines
550 B
PHP

<?php
// CORS headers for web interface
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Methods: POST, GET, OPTIONS");
header("Access-Control-Allow-Headers: Content-Type");
header("Content-Type: application/json; charset=UTF-8");
// Handle preflight OPTIONS request
if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
http_response_code(200);
exit();
}
// include database and object files
include_once '../config/database.php';
// get database connection
$database = new Database();
$db = $database->getConnection();
?>