prepare("SELECT * FROM customers WHERE email = ?"); $stmt->execute([$_POST['email']]); $customer = $stmt->fetch(); if ($customer && password_verify($_POST['password'], $customer['password'])) { $_SESSION['customer_id'] = $customer['id']; $_SESSION['customer_name'] = $customer['name']; header('Location: portal.php'); exit; } else { $error_message = 'Invalid email or password.'; } } } ?>