From eaa0f0542f813aecdc3c8b8e8f3df6fe686114d7 Mon Sep 17 00:00:00 2001 From: Yustina Date: Mon, 24 Nov 2025 15:04:39 +0700 Subject: [PATCH] ganti css --- login.css | 29 +++++++++------- login.php | 101 +++++++++++++++++------------------------------------- 2 files changed, 47 insertions(+), 83 deletions(-) diff --git a/login.css b/login.css index 3f9393d..8dc718f 100644 --- a/login.css +++ b/login.css @@ -1,13 +1,5 @@ -body { -<<<<<<< HEAD - font-family: Arial, sans-serif; - background: #1e90ff; - display: flex; - justify-content: center; - align-items: center; - height: 100vh; - margin: 0; -======= +body +{ font-family: Poppins, Arial, sans-serif; background: linear-gradient(135deg, #d9a7ff, #fbc2eb, #a1c4fd); min-height: 100vh; @@ -15,7 +7,6 @@ body { display: flex; justify-content: center; align-items: center; ->>>>>>> 149dc47c4d90a64a3fe437ba26e7cf4d1cbbbf50 } /* Background animation circles */ @@ -75,22 +66,34 @@ body { justify-content: center; margin-bottom: 25px; } + .icon-circle { background: linear-gradient(135deg, #7928ff, #ff0080); padding: 22px; border-radius: 50%; box-shadow: 0 6px 20px rgba(255,0,128,0.4); } -.login-icon { width: 45px; height: 45px; } + +.login-icon { + width: 45px; + height: 45px; +} /* Header Text */ -.header-text { text-align: center; margin-bottom: 20px; } +.header-text { + text-align: center; + margin-bottom: 20px; +} + .header-text h2 { background: linear-gradient(45deg, #7928ff, #ff0080); + -webkit-background-clip: text; + background-clip: text; color: transparent; font-weight: 700; font-size: 28px; } + .header-text p { color: #333; font-size: 14px; diff --git a/login.php b/login.php index 0ced915..4832e8c 100644 --- a/login.php +++ b/login.php @@ -1,50 +1,39 @@ true, 'message' => 'Login sukses']); - exit; - } else { - header("Location: dashboard.php"); - exit; - } - } else { - $isAjax = !empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest'; - if ($isAjax) { - header('Content-Type: application/json'); - echo json_encode(['success' => false, 'message' => 'Username/password salah']); - exit; - } else { - echo "Username/password salah"; - } - } +if (isset($_POST['username'])) +{ + $username=$_POST['username']; +} +else $username =''; +if (isset($_POST['password'])) +{ + $password=$_POST['password']; +} +else $password =''; +if ($username!='' || $password!='') +{ + $stmt = mysqli_prepare($conn,"select * from user where username=? and password=?"); + $enc=md5($password); + mysqli_stmt_bind_param($stmt,"ss", $username,$enc); + mysqli_stmt_execute($stmt); + + $result = mysqli_stmt_get_result($stmt); + if ($row=mysqli_fetch_assoc($result)) + { + echo "Login sukses"; + $_session['firstname'] = $row['firstname']; //simpan session firstname + $_session['lastname'] = $row['lastname']; + header("Location:dashboard.php"); //untuk pindah ke halaman dashboard.php + + echo "firstname:".$row['firstname']."
";//kalo di file yang sama + echo "lastname:".$row['lastname']."
"; + } + else echo "Username/password salah"; } ?> -
@@ -53,32 +42,4 @@ if ($username != '' && $password != '') {
- -======= -include "koneksi.php"; - -$username = $_POST['username']; -$password = $_POST['password']; - -$query = mysqli_query($conn, "SELECT * FROM users WHERE username='$username'"); -$user = mysqli_fetch_assoc($query); - -if (!$user) { - echo json_encode(["status" => "error", "msg" => "Username tidak ditemukan"]); - exit; -} - -if ($user["password"] !== $password) { - echo json_encode(["status" => "error", "msg" => "Password salah"]); - exit; -} - -echo json_encode([ - "status" => "success", - "id" => $user["id"], - "username" => $user["username"], - "email" => $user["email"], - "role" => $user["role"] -]); -?> ->>>>>>> 034e71546358d1709edc3df62da8342c7a9fa647 + \ No newline at end of file