Update API URL to be dynamic

This commit is contained in:
mstfyldz
2026-02-22 17:32:39 +03:00
parent 8b9d1891fa
commit 016a157f52

View File

@@ -424,7 +424,11 @@ if (!isset($_SESSION['admin_logged_in']) || $_SESSION['admin_logged_in'] !== tru
</div> </div>
<div class="api-url" id="apiUrl"> <div class="api-url" id="apiUrl">
https://yourdomain.com/api/app.php <?php
$protocol = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http";
$host = $_SERVER['HTTP_HOST'];
echo $protocol . "://" . $host . "/api";
?>
</div> </div>
<button class="copy-btn" onclick="copyApiUrl()">📋 Kopyala</button> <button class="copy-btn" onclick="copyApiUrl()">📋 Kopyala</button>