Jump to content


Photo

making sure an email contains all the fileds I want


  • Please log in to reply
4 replies to this topic

#1 barça

barça
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 11 June 2006 - 06:19 PM

Hi
For an email from a form, Ive been recommended the following php to send me the comments

$mailbody = $_POST['comments'];

but I also have three other IDs I want to enter from the html form.
these are
1 title
2 namefield
3 concerning

How do I add these multiple entries?

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 11 June 2006 - 06:23 PM

Change your code to this:
$mailbody = $_POST['title'] . "\n";
$mailbody .= $_POST['namefield'] . "\n";
$mailbody .= $_POST['concerning'] . "\n";
$mailbody .= $_POST['comments'];
Is that what you want?

If not could explain in more detail what you are trying to do.

#3 corillo181

corillo181
  • Members
  • PipPipPip
  • Advanced Member
  • 896 posts

Posted 11 June 2006 - 06:30 PM

maybe he wants those widthin the email in that case you change them to variables

$namefield=$_POST['namefield'];

them put all of them how ever you want the form to show..



#4 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 11 June 2006 - 06:32 PM

[!--quoteo(post=382590:date=Jun 11 2006, 07:30 PM:name=Richard181)--][div class=\'quotetop\']QUOTE(Richard181 @ Jun 11 2006, 07:30 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
maybe he wants those widthin the email in that case you change them to variables

$namefield=$_POST['namefield'];

them put all of them how ever you want the form to show..
[/quote]
Which is what I have done. [img src=\"style_emoticons/[#EMO_DIR#]/huh.gif\" style=\"vertical-align:middle\" emoid=\":huh:\" border=\"0\" alt=\"huh.gif\" /]

#5 barça

barça
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 11 June 2006 - 06:35 PM

Thankyou the code has worked fine!






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users