$_SESSION
and after this message has been " the session being destroyed, would be a good practice. and if not, in what ways can I do this?
My Example:
Login Simulation:
else{
//2.1- se der erro no passo anterior mostrar o erro
//criar uma sessão para mandar a mensagem na index
$_SESSION['erro'] ='Preencha os campos Corretamente!';
header('location:index.php');
}
Now this is the page that receives the message:
<?php
if (isset($_SESSION['erro'])) {
echo "<div class='card-panel yellow darken-4'>".$_SESSION['erro']."</div>";
session_destroy();
}?>