getUserByLoginAndPassword($username, $password); if ($user != false) { //use is found $_SESSION['name'] = $user['name']; header('Location: workArea.php'); } else { // user is not found with the credentials die ("username credentials are wrong. Please try again!"); } } else { // required post params is missing die ("Required parameters username or password is missing!"); } ?>