Checking the Password for Login

I wrote code that checks the password when logging in. When logging in to the blog, the user's given information (Username, Password) gets checked with their given information from when they registered which is stored in the database. If the given information is not valid, they are not able to login.