fix : deploy bug

This commit is contained in:
SatryaIrvannurYudha
2026-06-09 14:35:36 +07:00
parent 865e4bd577
commit 39572b461d
2 changed files with 41 additions and 5 deletions
+25 -5
View File
@@ -1,6 +1,26 @@
<?php
$host = "127.0.0.1";
$user = "root";
$pass = "";
$db = "webgis";
$conn = mysqli_connect($host, $user, $pass, $db);
// Deteksi otomatis lokasi server berjalan
if ($_SERVER['HTTP_HOST'] == 'localhost' || $_SERVER['HTTP_HOST'] == '127.0.0.1') {
// ----------------------------------------------------
// KONFIGURASI LOCALHOST (Laptop Anda)
// ----------------------------------------------------
$host = "127.0.0.1";
$user = "root";
$pass = "";
$db = "webgis";
} else {
$host = "127.0.0.1";
$user = "root";
$pass = "";
$db = "webgis";
}
// Membuat koneksi database
$conn = mysqli_connect($host, $user, $pass, $db);
// Cek jika koneksi gagal
if (!$conn) {
die("Koneksi database gagal: " . mysqli_connect_error());
}
?>