<?php

header('Content-Type: text/html; charset=UTF-8');

// Determina il percorso base dell'applicazione
$script_name = $_SERVER['SCRIPT_NAME'];
$script_path = dirname($script_name);
$base_path = rtrim($script_path, '/');
$base_url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$base_path";