Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more

Go Back   Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more > Web Programming > PHP Development
User Name
Password

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 10-09-2006, 10:46 AM   #1 (permalink)
Nester
Junior Member
 
Join Date: Oct 2006
Posts: 2
Default this one should be easy... (html form/php question)

ok so I have this form:

Code:
<form action="websiteurl/meadowform.php" method="post" id="form" style="margin:0; padding:0 "> <table cellpadding="0" cellspacing="0" border="0" <tr> <td valign="top" width="206" eight="232"> <div style="margin:19 0 0 22px "><img src="images/5_w2.gif" alt="" border="0" style="margin-left:-9px; margin-bottom:21px "><br> <input type="text" style=" width:182px; height:27px" value=" &nbsp;name:"><br><br style="line-height:1px "><input type="text" style=" width:182px; height:27px" value=" &nbsp;e-mail:"><br><br style="line-height:1px "><input type="text" style=" width:182px; height:27px" value=" &nbsp;phone:"><br><br style="line-height:1px "><input type="text" style=" width:182px; height:27px" value=" &nbsp;preference (email or phone):"></div> </td> <td valign="top" width="320" height="232"> <div style=" margin:49 0 0 0px"><textarea cols="35" rows="35" style=" width:272px; height:117px; overflow:hidden " > &nbsp;How we can help you:</textarea><br><br style="line-height:7px "> <img alt="" src="images/spacer.gif" width="150px" height="1px"><a href="#" onclick="document.getElementById('form').reset()"><font color="#330000">RESET</font></a><img alt="" src="images/spacer.gif" width="28px" height="1px"><a href="index-ty.htm" onclick="document.getElementById('form').submit()"><font color="#330000">SUBMIT</font></a> </div> </td> </tr> </table> </form>

and I've go this script named meadowform:

Code:
<?php if(isset($_POST['submit'])){ $message = null; foreach($_POST as $k => $v){ if($k!='submit') $message .= "$k: $v\n\n"; } } mail('email@companyname.com', 'someone has contacted you from companyname.com', $message); ?>

Now I want to have the script email me (as it does now) when someone hits the submit button, however I would like to include the text fields above (name, email, phone, preference, and comments) in the email that gets sent to me.

Anyone able to help me with what needs to be included in the PHP script to capture the form data and include it in an email to mysef without posting to a DB?
Nester is offline   Reply With Quote
Sponsored Links
Old 10-24-2006, 10:33 AM   #2 (permalink)
Itsacon
Junior Member
 
Itsacon's Avatar
 
Join Date: Sep 2006
Location: Sector ZZ9 Plural Z Alpha
Posts: 34
Send a message via ICQ to Itsacon
Default Re: this one should be easy... (html form/php question)

Your code seems to be doing that already:
the lines
Code:
foreach($_POST as $k => $v){ if($k!='submit') $message .= "$k: $v\n\n"; }
takes each element in the FORM on the previous page, and places it in the message body.
__________________
"The biggest problem encountered while trying to design a system that was completely foolproof, was, that people tended to underestimate the ingenuity of complete fools."
---Douglas Adams
Itsacon is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Points Per Thread View: 1.00
Points Per Thread: 11.00
Points Per Reply: 5.00



» Sponsors

» Links

» Affiliates
Web Hosting
Marketing Find
Merchant Select
SiteMap Builder
Host Compare
Dedicated Servers

» Links

» Sports Network
Paintball Forum
Football Forum
Hockey Forum
Golf Forum
Boxing Forum
Lacrosse Forum
Baseball Forum
SnowBoarding Forum
Soccer Forum
MMA Forum


All times are GMT -4. The time now is 12:16 PM.



LinkBacks Enabled by vBSEO 3.0.0 RC8
Webmaster Forums