Jump to content

Display part of page in php


Recommended Posts

Hi,

I have one php page named as index.php which contains one 'form' and one 'table', both are in different div

Now i have two different types of users 'admin'  and 'nonadmin'.

If user log in as 'admin' he can see whole index.php (with form and table), and if user login as 'nonadmin' he can see only half part of index.php page (only form).

I knw there are ways to do it like use css hide n show function.. but confuse about the logic to do that.

Thanks

Link to comment
Share on other sites

You would never want to "hide" the content using style properties. You should instead determine of the user is a normal user or admin and then only output the relevant content.

 

$userType = {SOME PROCESS TO DETERMINE USER TYPE };

echo "This is output for all users";

if($userType =="ADMIN")
{
    echo "This is output for all users";
}

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.