finally, a working login script. created new login object in  login.php to handle the form submit