I have found numerous examples on forcing he download of a file with PHP, but none of them show how to do this from a new page (e.g. a thank you for downloading page, with a button to start download if it didn’t start already). When ever I use the header attachment method it just downloads the file whilst leaving the browser on the page I was on when I click the link.
I want to be able to show a new page and automatically start the download. How do I do this with PHP?
It can be done by meta refresh on the “Thank you page” that you want where
5is in seconds, change it to be a longer delay if you want.Then your download script where you’re pointing at
URL=/download.phpshould do the force download to what ever file it needs to serve.