I am currently using this method to download a query made.
mostrar_flush(1,"Espere un momento por favor mientras se termina la consulta 90%......");
$retorno[] = $ArrayPlanoCGUNO;
$retorno[] = "06";
$codigo_serialize= base64_encode(serialize($retorno));
/*
echo '<form id="frm1" name="frm1" action="http://evoluciondigital.com.co/websaas/interfase/historico-publicaciones/" method="post" target="_blank">
<input type="hidden" value="' . $codigo_serialize . '" name="datos">
</form>';*/
$urlServer='http://'.$_SERVER['SERVER_NAME'];
echo '<form id="frm1" name="frm1" action="'.$urlServer.'/interfase/index.php/historico-publicaciones/" method="post" target="_blank">
<input type="hidden" value="' . $codigo_serialize . '" name="datos">
</form>';
//Función que sirver para llamar el submit de el formulario y cargarse sin necesidad del boton enviar
echo "<script>
function formSubmit(){
document.getElementById('frm1').submit();
}
formSubmit();
</script>";
terminar_flush(1);
return true;
But it does not allow me to download the file to txt and it loads the server.
Is there any way to make it more optimal and not cause me so much inconvenience?