I have different users for my PHP web application. I have completed the implementation for one of the users. I want to know how to create “different views” according to the user who is logged in.
Should I create a directory as such?
/root/student/
/root/admin/
/root/admin
But with this approach, there’s going to be a lot of duplicating content.
Is there any general approach to this?
You should use templates for the front-end code generation not to duplicate the code.
There is no need to create directories. Human readable URLs parsing method depends mostly on the web server you use. In Apache look at
mod_rewrite.