0
I’m having difficulty putting a message saying : Data entered successfully and then send to another page.
<?php
include 'ligacao_pdo.php';
$condutor = $_POST['condutor'];
$carro = $_POST['carro'];
$matricula = $_POST['matricula'];
if (!$ligacao->query("INSERT INTO condutor (condutor, carro, matricula) VALUES ('$condutor', '$carro', '$matricula')"))
{
echo"SUCESSO";
header("location: add.php");
}
If you will redirect to another page, why display a message?
– Woss
Possible duplicate of Error - "Cannot Modify header information - headers already sent"
– Woss
If you succeed save the success message in a session variable, so on the other page you call the variable, I’ll do an example.
– Vinicius De Jesus