Changes to login.php and index.php (made by Cheng Chong)