Desa0101 Posted November 5, 2006 Share Posted November 5, 2006 I want to create a download button that would send a user to a "Thank you for downloading" page and then have the page automatically serve up a download. I know this is supposed to be simple to do but I haven't been able to get it to work. Thanks for your help. Link to comment https://forums.phpfreaks.com/topic/26244-download-file-and-redirect-to-a-page/ Share on other sites More sharing options...
CBStrauss Posted November 5, 2006 Share Posted November 5, 2006 well way i would do that is have the file info stored in a database then when they press the download button. Send the file information that is stored in the database through the link to the next page.Then when it gets to the thank you page it will display the message and then query the database for information and download from there.for example the link would look like this[code]<a href = "download.php?id=1>Download</a>[/code]Then on the download.php page have something like this[code]// Query your database to find the path to the file that is under id 1// display your thank you message// download file[/code]hope that helps a bit Link to comment https://forums.phpfreaks.com/topic/26244-download-file-and-redirect-to-a-page/#findComment-120078 Share on other sites More sharing options...
Desa0101 Posted November 5, 2006 Author Share Posted November 5, 2006 That's basically what I've been trying but it never gets to the thank you page.I just serve the download using a location header but I don't understand how to send the download and then send the visitor to a new page. Link to comment https://forums.phpfreaks.com/topic/26244-download-file-and-redirect-to-a-page/#findComment-120085 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.