76
rated 0 times
[
82]
[
6]
/ answers: 1 / hits: 15448
/ 12 Years ago, fri, august 3, 2012, 12:00:00
Page 1 links to page 2. Page 2 serves a download using the following code:
header(Content-disposition: attachment; filename= '$filename');
header('Content-type: application/pdf');
readfile($file);
header(location: mainpage.php);
The result being the user stays on page 1 but is served a download.
How can I set things up, so that users remain on page 1 but it refreshes after the download is served.
I don't know javascript so I am hoping for a purely PHP solution.
More From » php