I have to allow a user to download after he has submitted his USER data.
I’ve created three pages,
-
will display files available for download(catalogue_downloads.html)
-
will take in USER data (form_collecting.php)
-
will take user data validate it send it to an email address and redirect to downloads page (mail.php)
The schema is so catalogue_downloads.html->form_collecting.php->mail.php->catalogue_downloads.html
I am able to redirect to catalogue_downloads but how can I make the user download the file he requested via PHP
Thank you
Regards
Vinoth
http://php.net/manual/en/function.readfile.php read the first part (forcing a download), you can read a file and then sending it to the user via the headers. Thus you don’t have to give away your file structure (and perhaps even letting the file outside your website’s root/public_html).