Question

I am creating my first web app from scratch using PHP. I won't be using a framework. My proposed file structure looks something like:

index.php
/images
/css
/js
/classes
/includes
/views
/modules (blog, forum, etc.)

I'm also considering including /admin maybe.

What concrete decisions/considerations do I need to make before taking an approach, i.e. choosing between {mywebapp}.com/login (for both users and admin) or {mywebapp}.com/admin (for just the administrators)? And why?

Was it helpful?

Solution

/public
   /images
   /css
   /js
   index.php
/classes
/includes
/views
/modules (blog, forum, etc.)

Your doc_root would by site-path/public.

An admin should be a user with extra privileges. As long as your login process is secure, there is no reason for a separate admin login.

OTHER TIPS

This is a UI(user interface) question. I cant find any clear programmatic advantage for either of them, and have seen frameworks implement both of them.

In my opinion, you should have a special login page for the admin if you have a distinct and separate 'back office' or a specialized admin panel. If the admin is like any other user, but with extra privileges, using a combined login seems like the way to go.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top