Skip to content

Commit 5ae6786

Browse files
committed
still have a prob in con DB #2
1 parent 9c08ebc commit 5ae6786

1 file changed

Lines changed: 3 additions & 11 deletions

File tree

pages/auth/login.php

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,17 @@
55
$error = "";
66

77
if (isset($_POST['login'])) {
8-
9-
// Sanitize input
108
$gmail = mysqli_real_escape_string($conn, $_POST['gmail']);
11-
$password = $_POST['password']; // raw password
12-
13-
// Fetch user from database
9+
$password = $_POST['password'];
10+
\\
1411
$sql = "SELECT * FROM userdata WHERE gmail='$gmail'";
1512
$result = mysqli_query($conn, $sql);
1613

1714
if (mysqli_num_rows($result) > 0) {
1815
$user = mysqli_fetch_assoc($result);
1916

20-
// Verify password using password_verify()
2117
if (password_verify($password, $user['password'])) {
22-
$_SESSION['gmail'] = $user['gmail']; // store session
18+
$_SESSION['gmail'] = $user['gmail'];
2319
header("Location: ../Saklaw/home.php");
2420
exit();
2521
} else {
@@ -36,11 +32,7 @@
3632
<meta charset="UTF-8">
3733
<meta name="viewport" content="width=device-width, initial-scale=1.0">
3834
<title>Login</title>
39-
40-
<!-- Your CSS -->
4135
<link rel="stylesheet" href="../../../Saklaw/assets/css/auth.css">
42-
43-
<!-- Bootstrap Icons -->
4436
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css">
4537

4638
<style>

0 commit comments

Comments
 (0)