Added functionality to login.php