My intention is that at the time of deleting an invoice, it returns to the notes index page for that work.
Code:
{
$id = $_POST['id'];
$ok = $_GET['obra'];
//Delete do banco:
$pdo = Banco::conectar();
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$sql = "DELETE FROM notas where id = ?";
$q = $pdo->prepare($sql);
$q->execute(array($id));
Banco::desconectar();
header('Location: index01.php?obra=' . $ok);
}