Skip to content

Instantly share code, notes, and snippets.

@kevinacuna1
Created March 1, 2023 19:35
Show Gist options
  • Select an option

  • Save kevinacuna1/f7395de59ae31a7b13fb11dd2bef0fc6 to your computer and use it in GitHub Desktop.

Select an option

Save kevinacuna1/f7395de59ae31a7b13fb11dd2bef0fc6 to your computer and use it in GitHub Desktop.
includes/
<?php
function debuguear($variable): string
{
echo "<pre>";
var_dump($variable);
echo "</pre>";
exit;
}
// Escapa / Sanitizar el HTML
function s($html): string
{
$s = htmlspecialchars($html);
return $s;
}
/** Función que resiva que el usuario esté autenticado */
function isAuth(): void
{
if (!isset($_SESSION['login'])) {
header('Location: /');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment