fix: perbaikan pada koneksi database tugas pertemuan 2

This commit is contained in:
2026-06-10 01:33:12 +07:00
parent 0f0ff44bd0
commit 1cccc69e14
+3 -2
View File
@@ -1,7 +1,8 @@
<?php <?php
$host_sekarang = $_SERVER['SERVER_NAME']; $host_sekarang = $_SERVER['HTTP_HOST'];
if ($host_sekarang === 'localhost' || $host_sekarang === '127.0.0.1') { // Cek apakah URL yang sedang diakses mengandung kata 'localhost' atau '127.0.0.1'
if (strpos($host_sekarang, 'localhost') !== false || strpos($host_sekarang, '127.0.0.1') !== false) {
$host = "localhost"; $host = "localhost";
$user = "root"; $user = "root";
$pass = ""; $pass = "";