<?php session_start();if(!isset($_SESSION['authenticated'])||$_SESSION['authenticated']!==true){header('HTTP/1.1 403 Forbidden');exit('Non autorisé');}$countriesFile='allowed_countries.php';$countries=[];if(file_exists($countriesFile)){$content=file_get_contents($countriesFile);if(preg_match('/\$country\s*=\s*array\(([^)]*)\);/',$content,$matches)){$countriesString=$matches[1];$countries=array_map(function($item){return trim($item,"'\" ");},array_filter(explode(',',$countriesString)));}}header('Content-Type: application/json');echo json_encode(['status'=>'success','countries'=>$countries]);?>