if (...) { // I am using echo here. } else if ($_SESSION['qnum'] > 10) { session_destroy(); echo "Some error occured."; // Redirect to "user.php". }