I have a method in php that performs certain task and then I need to give a success / error feedback to the user and return to my index.php. This feedback can occur both before returning as in my own index.php. My current scenario is as follows:
$conexao->setSQL("INSERT INTO tab VALUES ('x');
$resultado = $conexao->Executar();
$erroRegistros = $totalRegistros - $adicRegistros;
if(!$resultado){
die("erro in uploading the file". mysql_error());
} else{
// FEEDBACK NECESSÁRIO E RETORNO AO MEU INDEX
voltarIndex();
}
In this class, there are only codes in php. Already in my index.php there are codes html, javascript and inclusive, php.
For questions, my backIndex () method follows below:
function voltarIndex() {
header("Location: index.php");
}
Could anyone help me?