finished working script to check the username and password of a user