made a login function, checks the username (email address) and password, redirects to root if correct, else to the login page again.