byoung42 Posted August 24, 2011 Share Posted August 24, 2011 I am building a website that allows a client to email me documents (DocX, PDF, TXT,ZIP, etc) along with a simple HTML based form. I used DreamWeaver to create the form and the upload area. I figured out how to script the PHP code to send the text fields to my email address (and validate them), but I can't figure out how to get the attachments to send. I am BRAND NEW to PHP and just trying to figure all thing out. Any help would be appreciated. I have attached two .txt files to this post. One is the HTML code for the forum and one is the actual PHP code I am using to send the form to my email. Thanks for your help! [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/245590-how-do-i-get-an-attachment-in-an-html-form-dreamweaver-to-email-to-me/ Share on other sites More sharing options...
mfreitas Posted August 24, 2011 Share Posted August 24, 2011 I think you have to add, in the first line of the form (where you have the action and method) this "enctype="multipart/form-data" and then a line where you create the field to upload the file, "<tr> <td><input type = "file" name = "teste_ficheiro" size = "100"><td/> <tr/> " Hope it helps! Link to comment https://forums.phpfreaks.com/topic/245590-how-do-i-get-an-attachment-in-an-html-form-dreamweaver-to-email-to-me/#findComment-1261482 Share on other sites More sharing options...
byoung42 Posted August 24, 2011 Author Share Posted August 24, 2011 The encype="multipart/form-data is already in the HTML form. Does it need to be in the PHP processing code? If so, where? Also, the "size" command in html is changing the actual file upload field, not the file size capacity.... once again, if I am understanding correctly. Do I need to do anything to the PHP process to get the attached files to send? Or is there something in the HTML I still need to do? Thanks for your help! Link to comment https://forums.phpfreaks.com/topic/245590-how-do-i-get-an-attachment-in-an-html-form-dreamweaver-to-email-to-me/#findComment-1261524 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.