Attaching image file to email form
View Single Post
05-21-2010, 01:29 AM
is cute and cuddly
Join Date: Mar 2008
Location: Vegas, Baby
My first suggestion would be to avoid recreating the wheel. There are libraries out there that make this stupid simple, such as PHPMailer.
That aside, if it's for learning purposes, if you have plans to make this available for your web site, I would work heavily on doing some form validation. You're using unvalidated unfiltered values which opens you WIDE up to a variety of attacks. Don't forgo security in favor of speed to complete an application, ever.
You are going to want to look up php file handling, in particular, the $_FILES superglobal that automatically populates with information from a forms file input field. The next thing you are going to want to research is the proper mail headers to attach a file, as the basic headers you are sending above won't permit this.
View Public Profile
Send a private message to delayedinsanity
Visit delayedinsanity's homepage!
Find More Posts by delayedinsanity