Please enter both email and password.'; } else { try { $pdo = db(); $stmt = $pdo->prepare("SELECT * FROM hospitals WHERE email = ?"); $stmt->execute([$email]); $hospital = $stmt->fetch(); if ($hospital && password_verify($password, $hospital['password'])) { if ($hospital['status'] == 'verified') { $_SESSION['hospital_id'] = $hospital['id']; $_SESSION['hospital_name'] = $hospital['hospital_name']; header("Location: hospital_dashboard.php"); exit(); } else { $message = '
Your account is pending verification by the administrator.
'; } } else { $message = '
Invalid email or password.
'; } } catch (PDOException $e) { $message = '
Error: ' . $e->getMessage() . '
'; } } } ?> Hospital Login - Organ Donation Management System

Hospital Login