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
https://forums.phpfreaks.com/topic/263661-display-part-of-page-in-php/
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";
}

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.