Jump to content

Suggestion about admin and user index page..


siabanie

Recommended Posts

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.

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
  }
}

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.