I have a code that gets some data and send it to a php page that makes the process and finally shows the result of this process without reload the page:
So, I hace this code that calls process.php file.
$(document).ready(function(){
$("#btEnviar").click(function (){
var datos = $("#formulario").serialize();
$.ajax({
type: "POST",
url: "process.php",
data: datos,
contentType: "application/x-www-form-urlencoded",
beforeSend: function() {
$("#status").html("Enviando....");
},
dataType: "html",
success: function(datos){
if(datos == 1){
$("#status").html("Script procesado satisfactoriamente");
}else if(datos == 0){
$("#status").html("Error al procesar script");
}
}
});
});
});
It is possible to make a progress bar of process.php ?
Thanks in advance for your help.
Have you looked at http://php.net/manual/en/session.upload-progress.php
Note, it doesn't work in fastCGI mode
You may use some ready-made solution like Reload Progress Bar. However, check this post first File upload progress bar with jQuery. I hope it helps.