Uses global variables to connect to DB
Adds login validation code