0
I want to show a success message after the user changes password, with bootstrap and PHP.
Follow what I’m trying to do:
if($login == null){
header("Location: index.php");
} else {
$_SESSION["email"] = $email;
header("Location: dashboard.php");
$_SESSION['mensagem'] = '<div class="alert alert-success" role="alert">Senha alterada com sucesso!</div>';
}
die();
And calling the variable on the page where the message should appear:
<?php echo $_SESSION['mensagem'] ;?>
Are you starting Session on the Dashboard.php side and on that file with the Location header ? If yes, this is ok, if not, start Session on both parts, then change the header: 'Location: htttp:/your domain/Dashboard.php', comment on whether to resolve or not
– AnthraxisBR
It was the full link! Thank you
– Pedro Ribeiro