How to create a page that has different information for each type of user? [closed]

5

It's my first question here in Stack overflow. Well, I would like to know how I would structure a page in php to display different information for different users, since I do not want to have more than one page for each type of user.

For example, supposing that you have two types of users, Administrator and Client, you would like the administrator to display an information X and for Client a Y information. Additional information: I have in Super Global $ _SESSION the user type.

Sincerely, Ericks Rodrigues.

    
asked by anonymous 27.11.2015 / 18:44

1 answer

2
<?php if ($_SESSION['tipo_usuario'] == 1) { ?>
    <p>informação do usurário tipo 1</p>
<?php } else { ?>
    <p>exibe informações do usuário 2</p>
<?php } ?>

Or

if ($_SESSION['tipo_usuario'] == 1) {
    \ exibe informações do usuário 1
} elseif ($_SESSION['tipo_usuario'] == 2) {
    \ exibe informações do usuário 2
} else {
    \ exibe informações comum a todos
}

If this is not what you want, add more information to your question.

    
27.11.2015 / 19:49