I'm not sure, did you get my post? It is exactly what you want. But instead of downloading first and then redirecting, html page is generated first (like redirect), this page is displayed, and then starts the download.

Jean-Christian IMbeault wrote:
Jason Sheets wrote:


Use PHP's file functions to read the file and output it to the browser, sending the attachment header so it opens the save as dialog. After you finish outputing the file unlink() the file.


You didn't quite catch what I wanted to do. No file exists on my server.
I just give a bunch of buttons to the user, the buttons are in a form.
The form's action is another PHP script.

That script generates some data and forces a save-as dialog to open so
the user can save the data as a file. The script also stores in a
database the fact that this user has generated this file so that the
next time he visits the button for generating this particular file will
not appear in the list again.

The problem is that the page the user is on doesn't change once he
clicks the button.

What I want is that after a button has been clicked the current page,
the I generate the data file, cause a save-as dialog to open, and then
reload the current page (file list) so that I can present the user with
a list of buttons (data files he can generate) again (with the button he
clicked no longer in the list).

Do-able?

Jean-Christian Imbeault




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to