|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
You don't need a fax machine to get faxes. Get a fax-to-email fax number from CallWave. Try it free.
|
|
#1
|
|||
|
|||
|
Form that will send email with attachment
I'm a _very_beginning_ PHPer trying to add functionality to my website. I'd like to allow a user to upload a photo and message in a simple form. It seems like this should be "easy" but I'm swamped by syntax and handicapped by a fear of adding MySQL into the mix.
Is there a simple script that will create a form with 2 fields, one for text input, one for a photo attachment, and then email the result to a specified email address? I would welcome a walkthrough of this, or script if anyone has it, or even just some wisdom about what it would entail. Embarrassing as they are, I'll throw out some of my basic questions: Is this even possible? How do I store the uploaded photo without a database? When I "submit," what's the syntax for passing the form data to the page that will process the input and generate the email? (I'm trying to use "POST" but it's not working.) Any script, URLs, tips, or advice would be greatly appreciated. Thank you so much. |
|
#2
|
|||
|
|||
|
I don't think anyone here is going to write the code for you, but you shouldn't need to involve a database in this sort of script. When you upload a file with PHP, it most commonly goes to a directory on the server. You then need to send the mail which should be done with a pre-written class, such as PHPMailer. Believe me, at this stage in your learning process, you don't want to get into the intricacies of doing your own email with attachment code.
I think the best way for you to find the information, is to break it down into parts and don't overwhelm yourself. Go to Google and search for the following. "php file uploads" "php superglobals" "php mail" "PHPMailer" "PHP mail injection" Also search this and the Developer Shed forums for posts on this subject, you will find plenty of information on what you want to do. Last edited by hammer65 : August 13th, 2007 at 03:12 PM. |
|
#3
|
|||
|
|||
|
Thanks for these details...this benefits me too....
I have found a lot of info by googling these stuffs. Thanks again! |
|
#4
|
||||
|
||||
|
on this site we have a tutorial for how to upload file and handle them... then for email part - check out PEAR::Mail_Mime - it has great docs on how to add attachments with example code.
Oh and PHPMailer is a viable option as well - though I have never used it. Reference: http://pear.php.net/package/Mail_Mime/docs
__________________
life is a game.... Have fun ----------------------------- http://www.phpwomen.org strength in unity PHPCommunity IRC #phpc on freenode |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Applications > Form that will send email with attachment |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|
|