0
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 performs this:
$id = $_POST['id'];
removeProduto($conexao, $id);
$_SESSION["success"] = "Produto removido com sucesso";
header("location:produto-lista.php");
die();
It deletes normally and returns the perfectly to the product-list.php that there’s that stretch on hold
<?php if(isset($_SESSION["success"])) { ?>
<p class="alert-success"><?= $_SESSION["success"]?></p>
<?php } ?>
I’ve tried to add the SESSION_START()
, already on another page, the login page. I saw with the var_dump
and says that $_SESSION["success"]
is null.
PHP Version 5.6.15
Xampp 3.2.2
The Session is enabled and global variables also.
On every page that occurs session, you need to use
session_start()
as first statement. Try adding it on both pages.– user28595