// Redirect user to login page header("Location: login.php"); exit;
// Redirect user to dashboard after login if ($user->login()) { header("Location: dashboard.php"); exit; } else { echo "Invalid username or password"; }In this example, the user is redirected to the dashboard page after a successful login. If the login fails, an error message is displayed. The package library used in these examples is the PHP standard library.