dcsimg
www.webdeveloper.com
Results 1 to 3 of 3

Thread: Making so that some members can see a div and some do not

  1. #1
    Join Date
    Feb 2012
    Posts
    15

    Unhappy Making so that some members can see a div and some do not

    I have a website where I want a certain element to be visible only to the members who have "permission".

    I have a table in my database named members with a number of members.
    In that table I have a field called usertype where I have some members who have "read" and some that have "write" as usertype, and I want that only those members who have user type "write" can see some divs on the page, etc. .

    Does anyone know how to do this?

  2. #2
    Join Date
    Jan 2010
    Posts
    38
    $sql=mysql("select usertype from members where ..................");
    while($sql2=mysql_fetch_array($sql)){
    $usertype=$sql2['usertype'];

    }
    //
    if($usertype=='write'){
    <div id='blah'> user see this div who have write permission</div>

    }

    if anyone know best solution than tell me that i also learn from seniors
    Last edited by experts585; 03-06-2012 at 11:31 PM.

  3. #3
    Join Date
    Feb 2012
    Posts
    15
    Quote Originally Posted by experts585 View Post

    $sql=mysql("select usertype from members where ..................");

    while($sql2=mysql_fetch_array($sql)){
    $usertype=$sql2['usertype'];

    }
    //
    if($usertype=='write'){
    <div id='blah'> user see this div who have write permission</div>

    }

    if anyone know best solution than tell me that i also learn from seniors
    I'm very very bad at this but that allwos me to get what members that have write as usertype right?

    Can I some how use this to know if the current logged in member has usertype write?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles