barça Posted June 11, 2006 Share Posted June 11, 2006 HiFor an email from a form, Ive been recommended the following php to send me the comments[code]$mailbody = $_POST['comments'];[/code]but I also have three other IDs I want to enter from the html form.these are1 title2 namefield3 concerningHow do I add these multiple entries? Quote Link to comment https://forums.phpfreaks.com/topic/11729-making-sure-an-email-contains-all-the-fileds-i-want/ Share on other sites More sharing options...
wildteen88 Posted June 11, 2006 Share Posted June 11, 2006 Change your code to this:[code]$mailbody = $_POST['title'] . "\n";$mailbody .= $_POST['namefield'] . "\n";$mailbody .= $_POST['concerning'] . "\n";$mailbody .= $_POST['comments'];[/code]Is that what you want?If not could explain in more detail what you are trying to do. Quote Link to comment https://forums.phpfreaks.com/topic/11729-making-sure-an-email-contains-all-the-fileds-i-want/#findComment-44353 Share on other sites More sharing options...
corillo181 Posted June 11, 2006 Share Posted June 11, 2006 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 Link to comment https://forums.phpfreaks.com/topic/11729-making-sure-an-email-contains-all-the-fileds-i-want/#findComment-44358 Share on other sites More sharing options...
wildteen88 Posted June 11, 2006 Share Posted June 11, 2006 [!--quoteo(post=382590:date=Jun 11 2006, 07:30 PM:name=Richard181)--][div class=\'quotetop\']QUOTE(Richard181 @ Jun 11 2006, 07:30 PM) [snapback]382590[/snapback][/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\" /] Quote Link to comment https://forums.phpfreaks.com/topic/11729-making-sure-an-email-contains-all-the-fileds-i-want/#findComment-44359 Share on other sites More sharing options...
barça Posted June 11, 2006 Author Share Posted June 11, 2006 Thankyou the code has worked fine! Quote Link to comment https://forums.phpfreaks.com/topic/11729-making-sure-an-email-contains-all-the-fileds-i-want/#findComment-44362 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.