Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created August 8, 2019 01:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/d135d4bd095d953004e664c427dd84fa to your computer and use it in GitHub Desktop.
Save parzibyte/d135d4bd095d953004e664c427dd84fa to your computer and use it in GitHub Desktop.
<?php
session_start();
#Recuperar los mensajes de un archivo
$mensajes = [];
if(file_exists("mensajes.txt")){
$mensajes = explode("\n", file_get_contents("mensajes.txt"));
}
?>
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<title>Tablero</title>
</head>
<body>
<h1>Hola <?php echo $_SESSION["usuario"]; ?></h1>
<a href="logout.php">Salir</a>
<a href="nuevo.html">Agregar mensaje</a>
<h3>Aquí están todos los mensajes del día:</h3>
<?php foreach ($mensajes as $mensaje) {
echo strip_tags($mensaje) . "<br>";
} ?>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment