I want to show a message with the error generated by a sentence in my BD and then redirect to another page, the code is as follows:
echo '<script language="javascript">alert("Error al Grabar Cheque:'.$arr[2].'");</script>';
sleep(5);
header('Location: index.php?controlador=ChequesController&accion=Listar');
$ arr [2] contains the error message, I even put the sleep to delay the execution of the redirection and the error can be seen. (I can only see the message if I remove the Header line). Any suggestions? Thanks