prepare("SELECT * FROM users WHERE student_id = ? AND email = ? AND role = ?"); $stmt->execute([$student_id, $email, $role]); $user = $stmt->fetch(); if ($user && password_verify($password, $user['password_hash'])) { $_SESSION['user_id'] = $user['id']; $_SESSION['user_role'] = $user['role']; header('Location: index.php'); exit; } else { $error = 'Invalid Credentials. Please check your UID, Email, and Role.'; if (isset($_POST['role'])) { // Detect if coming from landing modal header('Location: index.php?error=' . urlencode($error)); exit; } } } ?> Login - Online Election System

Election Login

Don't have an account? Register