Login Levels

0

How can I make it just show the user that they have $cargo == 'Administrador' ?

I have seen many being used with number, but I want to leave it registered with the name Administrator or Visitor and thus in the menu, to be able to be shown only to the user who is in charge Administrator.

Would it be something like this?

<?php
if($cargo == "Administrador"){
?>
        <li>
          <a href="?p=inicio">
            <i class="fa fa-home"></i> <span>Inicio</span>
          </a>
        </li>
<?php
    }
?>
    
asked by anonymous 11.07.2018 / 23:43

1 answer

3

Will I explain quick and objective in the right text?

When you validate the login, you will probably get the results of the query, the username and the field you are using to assign the access level, check?

Save them in a $_SESSION , so that you can always do verification and grant or deny access.

Your example is correct, just need to implement something in the sense I suggested.

    
12.07.2018 / 02:44