diff --git a/src/css/style.css b/src/css/style.css index 6ffdb2d..3496c59 100644 --- a/src/css/style.css +++ b/src/css/style.css @@ -64,4 +64,87 @@ .container-login form p a span { color: yellow; +} + +.container-register { + display: flex; + width: 100%; + height: 100dvh; + flex-direction: column; + justify-content: center; + align-items: center; +} + +.container-register h1 { + font-size: 100px; +} + +.container-register form { + text-align: center; + padding: 30px; +} + +.container-register form h2 { + margin-bottom: 20px; + font-size: 30px; + text-transform: capitalize; +} + +.container-register form input { + margin-bottom: 10px; + width: 200px; + height: 30px; + border-radius: 6px; + text-align: center; + background-color: black; + border: 1px solid white; + color: white; +} + +.container-register form input::placeholder { + color: #919191; +} + +.container-register form button { + border-radius: 6px; + width: 200px; + height: 30px; + margin-top: 40px; + font-size: 30px +} + +.container-register form button:hover { + border-radius: 6px; + width: 200px; + height: 30px; + margin-top: 40px; + font-size: 30px; +} + +.container-register form p { + margin-top: 10px; +} + +.container-register form p a { + color: white; + text-decoration: none; +} + +.container-register form p a span { + color: yellow; +} + +.container-board .chara { + display: flex; + flex-direction: column; + justify-content: space-around; + align-items: center; +} + +.container-board .chara .character { + display: flex; + width: 100%; + justify-content: center; + align-items: center; + flex-direction: column; } \ No newline at end of file diff --git a/src/index.php b/src/index.php index 0a2f649..f23e0cf 100644 --- a/src/index.php +++ b/src/index.php @@ -42,6 +42,7 @@ $db->close(); login + @@ -56,5 +57,9 @@ $db->close();

don't have account yet? register now!

+ + \ No newline at end of file diff --git a/src/leaderboard.php b/src/leaderboard.php index e69de29..963992d 100644 --- a/src/leaderboard.php +++ b/src/leaderboard.php @@ -0,0 +1,111 @@ +query($sql_leaderbord); + +// $leaderboard=[]; +// if($result&&$result -> num_rows >0){ +// while($row = $result->fetch_assoc()){ +// $leaderboard[]=$row; +// } +// } + +?> + + + + + + + + leaderboard + + + + + +
+
+ +

150pts

+
+ knight +
+
+
+ + + + + + + + + + + + + + + + + + '; + } + ?> + +
#UsernameScore
PTS
Belum ada pemain
+
+
+ + + \ No newline at end of file diff --git a/src/register.php b/src/register.php index e69de29..0c6e67e 100644 --- a/src/register.php +++ b/src/register.php @@ -0,0 +1,90 @@ + prepare($sql); + + $stmt->bind_param("sss",$email,$username,$hashpw); + + + if($stmt->execute()){ + + $new_user_id =$db-> insert_id; + + $sql_char = "INSERT INTO characters (user_id, name, poin) VALUES (?, ?, 0)"; + + $stmt_char = $db->prepare($sql_char); + $stmt_char->bind_param("is", $new_user_id, $username); + + if($stmt_char->execute()){ + header("location:index.php"); + exit(); + }else{ + $pesan_gagal = "Registrasi user berhasil, tapi gagal membuat karakter: " . $stmt_char->error; + } + $stmt_char->close(); + + }else{ + if($stmt->erno==1602){ + $pesan_gagal = "email atau username sudah pernah terdaftar"; + }else{ + $pesan_sukses = "Regitrasi gagal: ".$stmt->error; + } + } + $stmt -> close(); + } +}$db->close() +?> + + + + + + + + codebeater + + + + + +
+

codebeater

+
+

Register to get account

+
+
+
+
+ +

have an account? Login now!

+
+
+ + + + + \ No newline at end of file