I now try to made admin panel and there want add 3 section:
- Edit post
- Remowe post
- Add post
In file admin.php I using sesions, but I dont know how to seperate this 3 sections.
I want use this method made 3 section in page admin.php:
- /admin.php?id=edit
- /admin.php?id=remove
- /admin.php?id=add
I want ask you do this decision is correct ?
I would structure the code in such a way so that every one of my admin pages inherited from a single secure base class. All subclasses can implement what ever functionally they need so you won’t have one giant file and they can all easily be maintained from a security point of view. Your main entry point into the system can then be an admin.php page that invokes the right class and method based on your http params using a simple switch statement or other method to route the request.