How to insert a value of a variable in the PHP Header?

0

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); 
}
    
asked by anonymous 13.05.2018 / 06:22

0 answers