diff --git a/login.html b/login.html index 2d8fe22..c89dbe5 100644 --- a/login.html +++ b/login.html @@ -295,12 +295,12 @@ input:focus {

Login untuk bermain Memory Flip Card Game

-
+ - + - +
diff --git a/register.html b/register.html index d8305a0..1abb2b2 100644 --- a/register.html +++ b/register.html @@ -230,18 +230,18 @@ input:focus {

Buat Akun Baru ✨

Daftar untuk bermain Memory Card Game

- + - + - + - + - +
@@ -261,7 +261,7 @@ input:focus { let username = document.getElementById("username").value.trim(); let email = document.getElementById("email").value.trim(); let password = document.getElementById("password").value.trim(); - let confirmPassword = document.getElementById("confirmPassword").value.trim(); + let confirmPassword = document.getElementById("confirm_password").value.trim(); let errorBox = document.getElementById("errorBox"); errorBox.style.display = "none"; @@ -282,7 +282,7 @@ input:focus { return; } - if (password !== confirmPassword) { + if (password !== confirm_password) { showError("Password dan konfirmasi password tidak cocok"); return; } diff --git a/register.php b/register.php index 726884f..9a5858c 100644 --- a/register.php +++ b/register.php @@ -6,6 +6,11 @@ $email = $_POST['email']; $password = $_POST['password']; $confirm = $_POST['confirm_password']; +if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { + echo ""; + exit; +} + if ($password != $confirm) { echo ""; exit; @@ -17,7 +22,7 @@ if (mysqli_num_rows($cek) > 0) { exit; } -$hash = md5($password); +$hash = md5($password); $sql = "INSERT INTO user (username, email, password) VALUES ('$username', '$email', '$hash')"; if (mysqli_query($conn, $sql)) {