Aplicar MVC a perfil

This commit is contained in:
2026-09-30 12:09:54 +02:00
parent 4f6e15863e
commit 77e512be5b
2 changed files with 16 additions and 12 deletions
+14
View File
@@ -0,0 +1,14 @@
<?php
if (session_status() === PHP_SESSION_NONE) {
session_start();
}
// Redirección si el usuario no ha iniciado sesión
if (!isset($_SESSION['idUsuario'])) {
header('Location: login.php');
exit();
}
$nombreUsuario = htmlspecialchars($_SESSION['nombreUsuario'] ?? 'Usuario');
$avatarUsuario = htmlspecialchars($_SESSION['avatar'] ?? 'img/avatars/defaultProfile.jpeg');
?>