siabanie Posted February 21, 2011 Share Posted February 21, 2011 Hi all, Can anyone give me some suggestion please. I'm a bit stuck here -- I am trying to build an admin and user log in. Admin: can view and edit, delete and create the page. User: can only create their profile. The problem is: I have almost the same index page for admin and user. I wonder if we can make it one page instead depending on what sort of user it has been log in. Also, the create page also almost similar...I don't know how to work it out as when I use the back button it go back to admin page (as I set it admin_area.php) - Do I have to create two create page as well? Or is there any better way to deal these forms? Login page -> (If admin) -> admin_area.php (can view all of them and page contains: create.php, edit.php and delete.php) Login page -> (If user/member) ->user_area.php (page contains: create their profile only) Any inputs would be helpful. Thanks. Quote Link to comment Share on other sites More sharing options...
beegro Posted February 21, 2011 Share Posted February 21, 2011 You can separate the different screens out by content and just include the appropriate one in a single script. Something like: if ($valid_login) { if ($is_admin) { include 'admin_area.php'; } else if ($is_user) { include 'user_area.php'; } else { // some error here } } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.