Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Email selected attachments

Status
Not open for further replies.

jrwinterburn

IS-IT--Management
Joined
Jul 26, 2004
Messages
72
Location
GB
Hi Guys,

As it has been so long since I have coded anything in PHP, I can't think how to go about a form I am trying to code.

Basically, I have a small form which a visitor to my site will enter their email address and choose any of 4 checkboxes. These 4 checkboxes represent 4 PDF files residing on my web space.

I need to have the form generate an email to send to the email address entered, which will have attached the PDF(s) the visitor has requested.

Additionally, it will send me a notification email.

Any ideas where to start? I am trying to keep this as short and sweet as possible. I know how to create the email to and notification parts, just not sure how to go about the attachment(s) scenario...

Any help would be appreciated.

Thanks,

Jon
 
I would, in the script that generates the user with which the user interacts, create my four checkboxes of the form:

<input type="checkbox" name="doc[]" value="some reference to the first document">
<input type="checkbox" name="doc[]" value="some reference to the second document">
<input type="checkbox" name="doc[]" value="some reference to the third document">
<input type="checkbox" name="doc[]" value="some reference to the fourth document">

When the form is submitted, $_POST['doc'] will itself be an array, populate only with those values that the user checked. From there, it would be a simple matter of looping through $_POST['doc'] with a foreach(), using the values to figure out which documents to attach to the email.

Want the best answers? Ask the best questions!

TANSTAAFL!!
 
thank you - i will give that a bash!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top