Two values are sent from a form:
<form action="accion.php" method="post">
<p>Su nombre: <input type="text" name="nombre" /></p>
<p>Su edad: <input type="text" name="edad" /></p>
<p><input type="submit" /></p>
</form>
In the PHP file several processes are carried out that take a while to process:
$Master = new Maestro();
//----- PROCESOS
$cruzarCodigos = $Master->cruzarCodigos($_POST['nombre'], $_POST['edad']);
$cruzarNombres = $Master->cruzarNombres();
$cruzarFechas = $Master->cruzarFechas();
$calcularSueldos = $Master->calcularSueldos();
//----- MOSTRAR MENSAJE
$tpl = new Plantilla();
$tpl->assign('mensaje', 'PROCESO TERMINADO');
$tpl->display('procesado.tpl.php');
And in the Smarty template, a message is displayed after the process is finished.
<h5>{$mensaje}</h5>
Since the Submit button is clicked until the $ message is displayed, the screen freezes all the time it takes to process all processes. How can I show an image after clicking Submit and it disappears when I show the message?