Compare commits

...

2 Commits

View File

@ -63,14 +63,18 @@ if (isset($_POST['btn-register'])) {
$insert->bind_param("sss", $username, $email, $hash); $insert->bind_param("sss", $username, $email, $hash);
if ($insert->execute()) { 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"); header("Location: index.php?success=register");
exit; exit;
} else { } else {
// TUTUP DISINI JUGA (Sebelum pindah halaman)
$insert->close();
header("Location: index.php?register_error=Gagal mendaftar, coba lagi nanti."); header("Location: index.php?register_error=Gagal mendaftar, coba lagi nanti.");
exit; exit;
} }
$insert->close();
} }
/* ===================================================== /* =====================================================