From e95f8747a8aca19e392132b9dc9a487faa5f9689 Mon Sep 17 00:00:00 2001 From: Nathan Date: Sun, 14 Dec 2025 20:15:05 +0700 Subject: [PATCH] reversing something to see --- .vscode/launch.json | 15 ++ login.html | 404 ++++++++++++++++++++++++++++++++++++++++++++ login.php | 40 +++++ register.html | 321 +++++++++++++++++++++++++++++++++++ register.php | 46 +++++ 5 files changed, 826 insertions(+) create mode 100644 .vscode/launch.json create mode 100644 login.html create mode 100644 login.php create mode 100644 register.html create mode 100644 register.php diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..2ba986f --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,15 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "chrome", + "request": "launch", + "name": "Launch Chrome against localhost", + "url": "http://localhost:8080", + "webRoot": "${workspaceFolder}" + } + ] +} \ No newline at end of file diff --git a/login.html b/login.html new file mode 100644 index 0000000..692d2e6 --- /dev/null +++ b/login.html @@ -0,0 +1,404 @@ + + + + + +Login + + + + + + + +
+
+
+
+
+ + + + + + + + + + + + + +
+
+
+
+
+
+

Selamat Datang! ✨

+

Login untuk bermain Memory Flip Card Game

+
+ +
+ + + + + + +
+ + +
+ +

+ Belum punya akun? + Daftar Sekarang +

+ + + + + + \ No newline at end of file diff --git a/login.php b/login.php new file mode 100644 index 0000000..8b2a96e --- /dev/null +++ b/login.php @@ -0,0 +1,40 @@ + + alert('Username atau Password salah!'); + window.location.href='index.html'; + "; + exit; + } + + // Login sukses + $_SESSION['username'] = $row['username']; + $_SESSION['login'] = true; // Tambahan untuk cek status login nanti + + // PERBAIKAN 3: Arahkan ke file game kamu (sesuaikan nama filenya) + // Di screenshot ada mainboard.html, pakai itu. + echo ""; + exit; +} +?> \ No newline at end of file diff --git a/register.html b/register.html new file mode 100644 index 0000000..335a183 --- /dev/null +++ b/register.html @@ -0,0 +1,321 @@ + + + + + + Register Akun + + + + + + +
+ + + + + + + + + + + +
+
+
+ +

Buat Akun Baru ✨

+

Daftar untuk bermain Memory Card Game

+ +
+ + + + + + + + + + + + +
+ + +
+ + +
+
+ + + + + diff --git a/register.php b/register.php new file mode 100644 index 0000000..53fced8 --- /dev/null +++ b/register.php @@ -0,0 +1,46 @@ +alert('Semua data harus diisi!'); window.location='index.html';"; + exit; + } + + if ($password !== $confirm) { + echo ""; + exit; + } + + // Cek Username/Email di tabel 'users' + $stmt = mysqli_prepare($conn, "SELECT id FROM users WHERE username = ? OR email = ?"); + mysqli_stmt_bind_param($stmt, "ss", $username, $email); + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + + if (mysqli_stmt_num_rows($stmt) > 0) { + echo ""; + exit; + } + mysqli_stmt_close($stmt); + + $hashed_password = password_hash($password, PASSWORD_DEFAULT); + + // Insert ke tabel 'users' + $stmtInsert = mysqli_prepare($conn, "INSERT INTO users (username, email, password) VALUES (?, ?, ?)"); + mysqli_stmt_bind_param($stmtInsert, "sss", $username, $email, $hashed_password); + + if (mysqli_stmt_execute($stmtInsert)) { + echo ""; + } else { + echo "Error: " . mysqli_error($conn); + } + mysqli_stmt_close($stmtInsert); +} +?> \ No newline at end of file