jeskel
09-10-2004, 03:44 PM
Hi,
I am posting this thread to know how hard it is to achieve something like this and how I should process:
-users will submit a form in which they will provide a few personnal info as well as the name of a .pdf file. There will be a choice of something like 30 .pdf files and the user will only select one per form (the choice will be made based on the file name).
-Once the form submited, the data will be stored in a db. The admin of the site check all the submited data. If he notices a funky/bogus name, he will delete the data in question. If everything seems alright, the admin will click on a 'process' button, or something like that-
-Here is what happens when the 'process' button is being clicked: An email (only a few words) is sent to the user who submited the form at the address he/she provided. This email will have an attachement of the .pdf file chosen by the user. As you can guess, this needs to be automated.
So here are a few questions:
-how hard is it to add an attachement to an email using PHP?
-how can I attach the file requested based on the name submited (choices -when submiting the form- will be made using a drop down menu in order to avoid typos and such problems)? I mean, if the user choses to receive a file named 'thisfile.pdf', is it possible to automatically attach this file?
-The .pdf files must not be accessible if the user has not submited a form and if the admin has not 'processed' the user in question, so I thought about storing them above the web directory. Is that a good idea? Is that a problem for the attachement part?
Thanks in advance for your help and your advice. :)
I am posting this thread to know how hard it is to achieve something like this and how I should process:
-users will submit a form in which they will provide a few personnal info as well as the name of a .pdf file. There will be a choice of something like 30 .pdf files and the user will only select one per form (the choice will be made based on the file name).
-Once the form submited, the data will be stored in a db. The admin of the site check all the submited data. If he notices a funky/bogus name, he will delete the data in question. If everything seems alright, the admin will click on a 'process' button, or something like that-
-Here is what happens when the 'process' button is being clicked: An email (only a few words) is sent to the user who submited the form at the address he/she provided. This email will have an attachement of the .pdf file chosen by the user. As you can guess, this needs to be automated.
So here are a few questions:
-how hard is it to add an attachement to an email using PHP?
-how can I attach the file requested based on the name submited (choices -when submiting the form- will be made using a drop down menu in order to avoid typos and such problems)? I mean, if the user choses to receive a file named 'thisfile.pdf', is it possible to automatically attach this file?
-The .pdf files must not be accessible if the user has not submited a form and if the admin has not 'processed' the user in question, so I thought about storing them above the web directory. Is that a good idea? Is that a problem for the attachement part?
Thanks in advance for your help and your advice. :)