[ILUG] Using PHP to output HTML and download a fie
Conor Mac Aoidh
conormacaoidh at gmail.com
Sun Feb 12 17:20:00 GMT 2012
You could try opening a new tab for the file download and then have the
confirmation HTML in the current tab?
On Sun, Feb 12, 2012 at 4:14 PM, Niall O Broin <niall at linux.ie> wrote:
> 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 . . .
> Irish Linux Users' Group mailing list
> About this list : http://mail.linux.ie/mailman/listinfo/ilug
> Who we are : http://www.linux.ie/
> Where we are : http://www.linux.ie/map/
More information about the ILUG