How do I add image attachment to this email form in php and html?
-
This is the code I have so far. i don't mind about it being unsecure or badly written etc as it's just for a school project. I just want to add a jpeg, jpg, png and gif supported attachment box to it and limit the file size to 150kb (if possible). And also if I need anything important installed on my server for it etc. The code as seen here is working for me Any help would be great! :D <html> <head> <title>email</title> </head> <body> <form name="email" method="post"> <table align="center"> <tr> <td>from</td> <td> <input type="text" name="from" value=""> </td> </tr> <tr> <td></td> <td> <input type="hidden" name="to" value="[email protected]"> </td> </tr> <tr> <td>subject</td> <td><input type="text" size="30" name="subject" /></td> </tr> <tr> <td colspan="2"> <textarea name="body" cols="26" rows="4"> </textarea> </td> </tr> <tr> <td colspan="2"> <input type="submit" value="send" /> </td> </tr> </table> </form> <? function param($Name) { global $HTTP_POST_VARS; if(isset($HTTP_POST_VARS[$Name])) return($HTTP_POST_VARS[$Name]); return(""); } $from = param("from"); $to = param("to"); $subject = param("subject"); $body = param("body"); if($from != "" && $to != "" && $subject != "") { $headers = "From: " . $from . "\n" . "To: " . $to; mail("", $subject, $body, $headers); } ?> </body> </html>
-
Answer:
See the 3rd example at http://www.webcheatsheet.com/PHP/send_email_text_html_attachment.php
teaweeda... at Yahoo! Answers Visit the source
Related Q & A:
- How do I add a link to my email address in my SIGNATURE?Best solution by Yahoo! Answers
- How do I add an attachment?Best solution by Yahoo! Answers
- How can i add a link to an email?Best solution by Yahoo! Answers
- How can I add an attachment to a message?Best solution by Yahoo! Answers
- How can I send an attachment with my email?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.