I explain I'm doing a login with 3 profiles and I managed to identify what profile I enter and be sent to your module until there is everything right the problem arises when I close session is blank screen and does not return to the index where the form is login
I followed an example to make a login and the truth is I'm a novice in this, I hope you can help me This is my login
'
$correo=$_POST['correo'];
$clave=md5($_POST['clave']);
require_once('Conexion.php');
$conn = Conectar();
$stmt = $conn->prepare("SELECT id_usuario, nombre, apellido, correo, p.id_perfil, perfil FROM usuario u INNER JOIN perfil p ON p.id_perfil=u.id_perfil WHERE u.correo=:correo AND u.clave=:clave");
$stmt->bindParam(':correo',$correo);
$stmt->bindParam(':clave',$clave);
$stmt->execute();
if($stmt->rowCount()>=1){
session_start();
$fila=$stmt->fetch();
if($fila['id_perfil']==1)
{header("Location: administrador/index.php");}
if($fila['id_perfil']==2)
{header("Location: aprendiz/index.php");}
if($fila['id_perfil']==3)
{header("Location: root/index.php");}
}
else{
echo "<font color='red'>Datos No Validos</font>";
}
? > '
"my file that closes session"
<?php
session_start();
if(isset($_GET['tk']) && isset($_SESSION['token']) && $_GET['tk']==$_SESSION['token']){
session_destroy();
header("Location: index.php");
}
?>
I know that the problem is between the closing file and the login because in the login I'm not referring to the closing token and in the closing file I do not refer to the profiles I have in login and the truth is not how to do it I hope for your collaboration and thank you very much