Login Function

This implements the login function. The other pages need to have the
login function integrated.