restructured login.php