Form to page force download
| From: | Peter Lauri | Date: | Fri, 21 Apr 2006 06:53:42 +0000 |
| Subject: | Form to page force download | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-234463@lists.php.net to get a copy of this message | ||
Best group member,
I have this process:
1. Fill out a form on a web page
2. Lands on a thank you page and force a download of a pdf
Right now I solve this by outputting the thank you page and then using a
javascript to redirect to the download.php that consist of the following:
header('Content-type: application/pdf');
header('Content-Disposition: attachment; filename="eguide.pdf"');
readfile('http://www.thedomain.com/download/eguide.pdf');
Unfortunally it seams like some browsers blocks my javascript that redirects
to that address. If JavaScript is enabled, this works fine.
How would you solve this? Any method in PHP? I was hoping to be able to do
the thing that download.php does in the same file as the output of my thank
you page.
Thank you.