I am creating a website where there are two user intefaces. ONe for sellers and one for buyers. Currently, I am storing these files under a folder (e.g: /interfaces/frame.php) So for both cases the files are stored there.
I am able to authenticate the user by checking the database for user type and making sure if its a buyer they only get to see buyer interface and if seller then seller interface. The problem is that these files can publicly be accessed, so if you go to domain.com/interfaces/frame.php it will show it to you.
What changes can i make so that they are not publicly accessible but yet i can serve them to the user.
I am using include(“file.php”); for loading the respective user interfaces.
At its most basic you can add a check in each on of your files to make sure its called via an include,
main.php
then in includefile.php