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";
}
?>
-