PHP Applications
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Applications

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
You don't need a fax machine to get faxes. Get a fax-to-email fax number from CallWave. Try it free.
  #1  
Old March 29th, 2007, 01:28 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
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.

Reply With Quote
  #2  
Old August 13th, 2007, 03:10 PM
hammer65 hammer65 is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Aug 2007
Location: Nebraska
Posts: 55 hammer65 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 12 h 16 m 53 sec
Reputation Power: 1
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.

Reply With Quote
  #3  
Old September 14th, 2007, 10:43 PM
heroine heroine is offline
Registered User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Sep 2007
Posts: 11 heroine User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 6 m 42 sec
Reputation Power: 0
Thanks for these details...this benefits me too....
I have found a lot of info by googling these stuffs. Thanks again!

Reply With Quote
  #4  
Old September 15th, 2007, 06:53 AM
lig's Avatar
lig lig is offline
"Forum Nazi"
Codewalkers Demi-God (4500 - 4999 posts)
 
Join Date: Apr 2007
Location: Jacksonville, Fl
Posts: 4,719 lig User rank is Private First Class (20 - 50 Reputation Level)lig User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 Days 4 m 29 sec
Reputation Power: 6
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

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Applications > Form that will send email with attachment


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five &quot;checkpoints&quot; for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway