I'm trying to use the fpdf library with PHP to generate a PDF file and download that for the user which is fine as far as it goes, except that when the user clicks the submit button, having entered the necessary data, I want him to get a confirmation page AND have the PDF downloaded in one action. If I use fpdf's output method to download the file first, the confirmation HTML doesn't appear. If OTOH I first send the HTML, then fpdf complains that it can't send the file as the headers have already been sent.
I know what's going on here - both fpdf and php's normal output are sending headers, and that's one lot of headers to many, so what I need to do is send a multipart result to the browser. However, I'm having a hard time finding an answer. Search terms including php, download, and pdf simply get way too may hits.
This question is probably more proper to a PHP list, but I'm not on any of those, and the platform in use is Linux, so . . .
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!