Good day.
So I have a PHP PDO System, whereas, I have a main index file and lots of other php file components that I am including in the index.php.
For example, if a user clicks profile, instead of going to profile.php page, it is redirected to index.php?page=profile.php and it works just fine.
However, when you go directly to profile.php page without going through the index.php, the whole php code appears as html.
Now, is there any method that I can use to protect the include files so that it can't be open without first going through the index.php?