I have a question for planetsim.
In the code you posted, you are encrypting the PW before calling the DB. Wouldn't that fail everytime unless you are specifying the SALT?
I always let PHP choose a random salt. But then when I verify the user, I first find the username in the DB with:
SELECT * FROM users WHERE username = '_POST[username]'
Then I encrypt the _POST[password] using the one on file so that the salt is the same.
Have I been doing it wrong?