prepare("SELECT * FROM clients WHERE email = ?"); $stmt->execute([$email]); $client = $stmt->fetch(); if ($client && password_verify($password, $client['password'])) { $_SESSION['user_id'] = $client['id']; $_SESSION['user_role'] = 'client'; header("Location: index.php"); exit; } // Check coaches table $stmt = $pdo->prepare("SELECT * FROM coaches WHERE email = ?"); $stmt->execute([$email]); $coach = $stmt->fetch(); if ($coach && password_verify($password, $coach['password'])) { $_SESSION['user_id'] = $coach['id']; $_SESSION['user_role'] = 'coach'; header("Location: profile.php?id=" . $coach['id']); exit; } $errors[] = "Invalid email or password."; } } ?> Login

Login

Don't have a client account? Register as a Client

Are you a coach? Register as a Coach