connect_error) { die('Connection Failed: ' . $conn->connect_error); } $errors = []; if ($_SERVER['REQUEST_METHOD'] === 'POST') { $email = trim($_POST['email']); $password = $_POST['password']; if (empty($email)) $errors[] = 'Email is required'; if (empty($password)) $errors[] = 'Password is required'; if (empty($errors)) { $stmt = $conn->prepare('SELECT id, name, password FROM users WHERE email = ?'); $stmt->bind_param('s', $email); $stmt->execute(); $stmt->store_result(); if ($stmt->num_rows > 0) { $stmt->bind_result($id, $name, $hashed_password); $stmt->fetch(); if (password_verify($password, $hashed_password)) { $_SESSION['user_id'] = $id; $_SESSION['user_name'] = $name; header('Location: dashboard.php'); exit(); } else { $errors[] = 'Invalid password'; } } else { $errors[] = 'No account found with this email'; } $stmt->close(); } } ?> Login - Tbils Property

Login

    '.$error.''; ?>

Don't have an account? Register