I am trying to show a form depending on a value in the session variable, at the moment of starting the command I call several data and I store them in the session variable, one of these is an operator, but I want that if the variable has the operative word in the value ope, that this one shows a form, and if it does not have it to show another form
I know I have to do it with an if condition but the problem is that I can not find a way to do it with this, I hope someone can help me
this is the code with which I login
$statement = $conexion->prepare('SELECT usuarios.idUsuario, usuarios.email, usuarios.ope, usuarios.password, usuarios.nombre, usuarios.apellidos, usuarios.imagen, perfusu.genero, perfusu.edad, perfusu.ciudad, perfusu.estado, perfusu.edoCivil, perfusu.telCasa, perfusu.telCel, perfusu.domicilio, perfusu.datsFamilia, perfusu.viviendo, perfusu.actInteres, perfusu.profesion, perfusu.universidad, perfusu.profesion2, perfusu.profesion3, perfusu.diplomados, perfusu.talleres, perfusu.seminarios, perfusu.maestrias, perfusu.doctorados, perfusu.areaDesempenar, perfusu.sueldoDeseado, perfusu.empleo, perfusu.jefe, perfusu.puestoDesempenar, perfusu.salario, perfusu.periodo, perfusu.idioma, perfusu.nivel, perfusu.idioma2, perfusu.nivel2, perfusu.extra, perfusu.cv
FROM perfusu INNER JOIN usuarios ON usuarios.idUsuario WHERE usuarios.email = :email AND usuarios.password = :password'
);
$statement->execute(array(
':email' => $email,
':password' => $password,
));
$resultado = $statement->fetch();
if ($resultado !== false) {
$_SESSION['usuario'] = $resultado;
header('Location: ' . RUTA . '/perfil.php');
} else {
$errores .= '<li>Datos Incorrectos</li>';
}
}
require 'views/login.php';
the entire query is saved in the session but I do not know how to select the variable ope,
if ope is equal to operator show form, but show another.