-3
For example, I am validating the login to redirect to the pages according to the access level:
if($_SESSION['usuarioNiveisAcessoId'] == "1"){
header("Location: ./index.php/administrativo");
}elseif($_SESSION['usuarioNiveisAcessoId'] == "2"){
header("Location: ./index.php/colaborador");
}elseif($_SESSION['usuarioNiveisAcessoId'] == "3"){
header("Location: ./index.php/enfermagem");
}elseif($_SESSION['usuarioNiveisAcessoId'] == "4"){
header("Location: ./index.php/administradorlogistica");
}else{
header("Location: ./index.php/cliente");
}
and works well.
Now intended was for the same level of access redirect to more than one page. I don’t know if it’s possible, I tried it this way for Session Level 4, but it doesn’t direct:
if($_SESSION['usuarioNiveisAcessoId'] == "1"){
header("Location: ./index.php/administrativo");
}elseif($_SESSION['usuarioNiveisAcessoId'] == "2"){
header("Location: ./index.php/colaborador");
}elseif($_SESSION['usuarioNiveisAcessoId'] == "3"){
header("Location: ./index.php/enfermagem");
}elseif($_SESSION['usuarioNiveisAcessoId'] == "4"){
header("Location: ./index.php/administradorlogistica");
}else($_SESSION['usuarioNiveisAcessoId'] == "4"){
header("Location: ./index.php/alertas3");
}
and also tried this:
if($_SESSION['usuarioNiveisAcessoId'] == "1"){
header("Location: ./index.php/administrativo");
}elseif($_SESSION['usuarioNiveisAcessoId'] == "2"){
header("Location: ./index.php/colaborador");
}elseif($_SESSION['usuarioNiveisAcessoId'] == "3"){
header("Location: ./index.php/enfermagem");
}elseif($_SESSION['usuarioNiveisAcessoId'] == "4"){
header("Location: ./index.php/administradorlogistica") AND header("Location: ./index.php/alertas3");
}else{
header("Location: ./index.php/cliente");
}
But it didn’t work either.
Well, what you’re trying to do is kind of exotic. How do you expect the browser to show two things at the same time? open a new tab?
– Diego Martins
@Diego Martins does not intend on another tab, but he is right, it is not possible what I intend. I thought it, not to have to create
– Bruno
I know that in python with flask da to create general templates and modify them according to the level of access of the person or other user properties, flask and a framework, try to take a look at PHP frameworks to do this for you and save hours of code possibly
– ScrapBench