This registration system, I have a button to delete the product in BD'
<form action="remove-produto.php" method="post">
<input type="hidden" name="id" value="<?=$produto['id']?>">
<button class="btn btn-danger">remover</button>
</form>
When it goes to remove product it does this:
$id = $_POST['id'];
removeProduto($conexao, $id);
$_SESSION["success"] = "Produto removido com sucesso";
header("location:produto-lista.php");
die();
It normally deletes and returns the perfectly to product-list.php that there is this stretch waiting
<?php if(isset($_SESSION["success"])) { ?>
<p class="alert-success"><?= $_SESSION["success"]?></p>
<?php } ?>
I've already tried to add SESSION_START()
, which is already on another page, the login. I saw with var_dump
and it says $_SESSION["success"]
is null.
PHP Version 5.6.15
Xampp 3.2.2
The session is enabled and global variables too.