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.

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.