On 12/02/2012, Niall O Broin <niall at linux.ie> wrote:
> 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.
I'd suggest not doing that.
Keep it as one request -> one response, and you'll probably find
things much easier.
If that is an acceptable solution, then you'll have request#2 which
results in the PDF being returned, and request#1 which results in the
html confirmation page which includes a normal link to request#2, and
which also induces the browser to make request#2 itself, via a html
Look at what happens when you try to download something from
sourceforge, for an example of how it can work.
> 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 . . .
"sourceforge" is a repository of some software that can run on Linux,
which preserves the tenuous link to being on-topic.
If you really want to do a multipart response, then the first question
is "do my target browsers support this adequately"; then comes "how do
I do the http-and-wrapping parts correctly in php"; and after that
"how to I fit the intended output into that wrapping".
I don't know the answers to any of those, which I why I suggest
avoiding the questions and causing two requests to be made (although
one should be automagically done by the browser).
Good luck with it,
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!