diff --git a/index.php b/index.php new file mode 100644 index 0000000..b02ef56 --- /dev/null +++ b/index.php @@ -0,0 +1,50 @@ +prepare('SELECT id, password FROM users WHERE username = ? LIMIT 1'); +$stmt->execute([$username]); +$user = $stmt->fetch(); +if ($user && password_verify($password, $user['password'])) { +session_regenerate_id(true); +$_SESSION['user_id'] = $user['id']; +$_SESSION['username'] = $username; +header('Location: menu.php'); +exit; +} else { +$err = 'Username atau password salah.'; + } + } +} +?> + + +
+ + +Belum punya akun? Daftar di sini
+