The way I would do it is I would make the Save button (or link) point to
display.php?save... Now in the display.php I would have it figure out if
save is in the URL, if it is then it should output a pdf file instead of a
html file.

This does however mean that your query is done twice (once for seeing the
results with the save button at the bottom, and then again when you hit
save).... If you only want your query run once then you must save the pdf on
the first attempt and then set the link to something like

Does that make sense?

If you need more guidance just email me.


----- Original Message -----
From: "Mukta Telang" <>
To: "php" <>
Sent: Thursday, July 31, 2003 11:27 AM
Subject: [PHP] fpdf

> Hi,
> I want to display the results generated by the query and generate a pdf
> doent (using fpdf) for the users to save. The user should be able to
> save
> it by clicking on a save button. I have a script called display.php
> which
> displays the result of the I want user to be able to save by
> pressing save button. That is I want to do this in the display.php
> script
> itself, because the result of the query is too large to POST to another
> script.
> If I do:
> $pdf->Output("/tmp/new.pdf"); then I can save the pdf doent..but I
> want this to happen only if the user clicks on save button and he/she
> should be able to download it by doing so.
> How to do this?
> Thanks in advance,
> Mukta
> --
> PHP General Mailing List (
> To unsubscribe, visit: