diff --git a/auth.php b/auth.php index f76d387..4179711 100644 --- a/auth.php +++ b/auth.php @@ -63,14 +63,18 @@ if (isset($_POST['btn-register'])) { $insert->bind_param("sss", $username, $email, $hash); if ($insert->execute()) { - // PERUBAHAN DISINI: Tambahkan ?success=register agar JS menampilkan pesan hijau + // TUTUP DISINI (Sebelum pindah halaman) + $insert->close(); + header("Location: index.php?success=register"); exit; } else { + // TUTUP DISINI JUGA (Sebelum pindah halaman) + $insert->close(); + header("Location: index.php?register_error=Gagal mendaftar, coba lagi nanti."); exit; } - $insert->close(); } /* =====================================================