Added passing of credentials in the ajax call. Added page redirection on success. Added showing of error message on failure.
Added checking of login credentials on server side.
Changed ajax call to use post method. Fixed showing of error message.
Added check which denies access if password is empty.