check the login details and redirect on the basic of username and password through the ajax