Compare commits
No commits in common. "ea5b6d74c45bf5f76fbf0aa07190129a361f7ef8" and "2282f020050ef4f967d6f59b95a8f21cf372af10" have entirely different histories.
ea5b6d74c4
...
2282f02005
@ -1,15 +1,13 @@
|
||||
<?php
|
||||
session_start();
|
||||
include "config/db.php";
|
||||
include "notif.php";
|
||||
|
||||
if(isset($_POST['login'])){
|
||||
$username = $_POST['username'];
|
||||
$password = $_POST['password'];
|
||||
|
||||
if(empty($username)||empty($password)){
|
||||
$msg = "Data Harus Lengkap !";
|
||||
echo "<script>showNotif(" . json_encode($msg) . ");</script>";
|
||||
echo "semua data harus terisi";
|
||||
}else{
|
||||
$sql = "SELECT * FROM users WHERE username =?";
|
||||
$stmt = $db -> prepare($sql);
|
||||
@ -23,15 +21,13 @@ if(isset($_POST['login'])){
|
||||
$_SESSION['loggedin']='true';
|
||||
$_SESSION['username']=$user['username'];
|
||||
$_SESSION['id']=$user['id'];
|
||||
header("location:onboard.php");
|
||||
header("location:leaderboard.php");
|
||||
exit();
|
||||
}else{
|
||||
$msg = "Password Salah !";
|
||||
echo "<script>showNotif(" . json_encode($msg) . ");</script>";
|
||||
echo "password salah";
|
||||
}
|
||||
}else{
|
||||
$msg = "Username tidak ditemukan !";
|
||||
echo "<script>showNotif(" . json_encode($msg) . ");</script>";
|
||||
echo "username salah";
|
||||
}
|
||||
$stmt->close();
|
||||
}
|
||||
@ -60,7 +56,6 @@ $db->close();
|
||||
<button type="submit" name="login" placeholder="input your password" data-aos="fade-up" data-aos-duration="3000">LOGIN</button>
|
||||
<p placeholder="input your password" data-aos="fade-up" data-aos-duration="3000"><a href="register.php">don't have account yet?<span> register now!</span></a></p>
|
||||
</form>
|
||||
<div id="notif" class="notif"></div>
|
||||
</div>
|
||||
<script src="https://unpkg.com/aos@2.3.1/dist/aos.js"></script>
|
||||
<script>
|
||||
|
||||
@ -1,40 +0,0 @@
|
||||
<div id="notif" class="notif"></div>
|
||||
|
||||
<style>
|
||||
.notif {
|
||||
position: fixed;
|
||||
top: 50px;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
background-color: #b2db0e1c;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
color: yellow;
|
||||
padding: 12px 18px;
|
||||
width: 300px;
|
||||
height: 25px;
|
||||
font-size: 20px;
|
||||
border: 1px solid yellow;
|
||||
border-radius: 8px;
|
||||
opacity: 0;
|
||||
transition: .3s;
|
||||
z-index: 9999;
|
||||
}
|
||||
.notif.show {
|
||||
opacity: 1;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
function showNotif(msg) {
|
||||
const n = document.getElementById("notif");
|
||||
n.textContent = msg;
|
||||
n.classList.add("show");
|
||||
|
||||
setTimeout(() => {
|
||||
n.classList.remove("show");
|
||||
}, 3000);
|
||||
}
|
||||
</script>
|
||||
Loading…
x
Reference in New Issue
Block a user