You need to understand when the output happens and what die headers do.
The "echo" will not execute (be send to browser) when the buffer is not flushed out. On the other hand, before flushin out HTML you decide to change the header (and therfore the data content type) and send a file - which makes your HTML invalid to be send to the browser.
Basic: One Connection - One type of output!
So what you can do is: Call your download in a new, blank window, while displaying the message on the curren page.
Mario ScheerenPosted Jun 8, 2020, 3:12 AM