I am working on a system where the user is only allowed to visit most of the pages if he is logged in correctly. Instead of checking for a correct login on every single page, I am about to make a check on the index page, and including all other subpages from this, if the login passes.
To be sure no one is able to access any other site through their direct url, I will place all pages outside the public_html and include them from here using the path '../page.php'.
Is this a safe way to do things, or am I missing any other security flaws?