prepare('SELECT * FROM users WHERE email = ?'); $stmt->execute([$email]); $user = $stmt->fetch(); if ($user && password_verify($password, $user['password'])) { if ($user['is_verified'] == 0) { $error = 'Please verify your email address before logging in. Check your inbox for the verification link. ' . 'Resend link?'; } else { $_SESSION['user_id'] = $user['id']; $_SESSION['user_email'] = $user['email']; $_SESSION['user_name'] = $user['name'] ?? 'User'; $_SESSION['user_role'] = $user['role'] ?? 'Standard User'; if ($_SESSION['user_role'] === 'Super User') { header('Location: admin_dashboard.php'); } else { header('Location: apply.php'); } exit; } } else { $error = 'Invalid email or password.'; } } } ?> Login — <?php echo htmlspecialchars($project_name); ?>

Welcome back

Please enter your details to sign in.

Forgot Password?

Don't have an account? Sign Up

Didn't receive activation email? Resend link