Moved the login to index.php page. When user is not logged in on other page, call header() to redirect to the index.php page.