Return something as well as the FALSE
<p>I am building a library and I want to know If there is a possibility and how the best approach could be done here: Basically I would want to have some different messages that I could display depending on the result in the class.</p>

<p>Psuedo:</p>

<pre><code>public function login($username, $password) {
    //query

    if (password hash is verified)

        if (active == false)
            (some sort of MESSAGE HERE! like "User is not activate...")
            return false

        if banned
            some sort of message
            return false
    else

        message (wrong username or password)
        return false
}

And then on the login

if (login(username, password))
    successfully
    redirect
else
    display the message
</code></pre>

<p>How is the way to implement this in a good approach? I assume I would need some sort of variable that I would give a value and then I would have some method()  that would return a error message if it is set, Am I right so far? How should I do it?</p>
