mengganti asset gambar buah

This commit is contained in:
Evelyn 2025-12-08 08:49:59 +07:00
parent 70a69384dc
commit ca24be2a5e
11 changed files with 13 additions and 8 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

View File

@ -1,8 +1,8 @@
<?php
if ($_SERVER["REQUEST_METHOD"] === "POST") {
$username = $_POST["username"];
$email = $_POST["email"];
$username = trim($_POST["username"]);
$email = trim($_POST["email"]);
$password = $_POST["password"];
$confirm = $_POST["confirm"];
@ -21,27 +21,32 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") {
exit;
}
// contoh simpan ke file JSON
$file = "users.json";
$users = file_exists($file) ? json_decode(file_get_contents($file), true) : [];
// 🔍 Cek username & email duplikat
foreach ($users as $u) {
if ($u["username"] === $username) {
if (strtolower($u["username"]) === strtolower($username)) {
echo "Username sudah digunakan";
exit;
}
if ($u["email"] === $email) {
if (strtolower($u["email"]) === strtolower($email)) {
echo "Email sudah digunakan";
exit;
}
}
// 🔐 Enkripsi password
$hashedPassword = password_hash($password, PASSWORD_BCRYPT);
// 📌 tambah user baru
$users[] = [
"id" => time(),
"id" => uniqid(),
"username" => $username,
"email" => $email,
"password" => $password,
"role" => "player"
"password" => $hashedPassword,
"role" => "player",
"created_at" => date("Y-m-d H:i:s")
];
file_put_contents($file, json_encode($users, JSON_PRETTY_PRINT));