2
Boa Pessoal,
I have a php file that is named after filling a form in an html file. The function of this php file is to add data to the database and after inserting it has the following code:
if(mysqli_query($con, $sql)){
echo "<script>
alert('Inscrição realizada'); //alerta1
</script>";
header('Location: ../register.htm');
}
else{
echo "<script>
alert('Inscrição não realizada');
</script>";
header('Location: ../register.htm');
}
But after clicking on Submit does not show alert1 nor goes to the page I am telling you to go to. Does anyone know how this is resolved? And someone knows how to go back to the page of form but leave text boxes blank?
How is the TAG
<form>
of your HTML ?– Diego Souza
It seems that the query is returning an error and falling into Else, comment the line of
header
to take the test. On Else add the lineecho mysqli_error($conexao);
– rray
Now there is no error simply this inserts into the database, goes to the page and does not give me the alert
– Bruno Gibellino