date('c'), 'ip' => $ip, 'ville' => $geo['city'] ?? 'inconnu', 'region' => $geo['regionName'] ?? 'inconnu', 'pays' => $geo['country'] ?? 'inconnu', ]; // Sauvegarder dans un fichier log file_put_contents('clics.log', json_encode($log, JSON_UNESCAPED_UNICODE) . "\n", FILE_APPEND); // Rediriger vers la destination réelle header("Location: $destination"); exit;