imagfinder Posted May 29, 2008 Share Posted May 29, 2008 I am not that familiar with PHP. I am trying to learn but dont know many people or places to go for help so maybe I have found the right place. I have an html form and when you click send it goes to a PHP page that sends an email with the answers to the form (that is what my client as for). The problem is that the answers run together. I dont know what the to use to make each answer go to a new line. Here is what I have: <?php $from='From: Surveryer' . $_POST["Survey Answers"]; $body=$_POST["1st_Q"] . $_POST["2nd_Q1"] . $_POST["2nd_Q2"] . $_POST["3rd_Q1"] . $_POST["3rd_Q2"] . $_POST["3rd_Q3"] . $_POST["3rd_Q4"] . $_POST["3rd_Q5"] . $_POST["3rd_Q6"] . $_POST["4th_Q"] . $_POST["5th_Q"] . $_POST["6th_Q"] . $_POST["6th_Q2"] . $_POST["7th_Q"] . $_POST["Email"]; $to="Client@mailaddress.com"; $subject="Client Survey"; if (mail($to,$subject,$body,$from)) { ?> Any help is greatly appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/107807-solved-forms-submitted-by-email/ Share on other sites More sharing options...
MadTechie Posted May 29, 2008 Share Posted May 29, 2008 Add "\n". ie <?php $from='From: Surveryer' . $_POST["Survey Answers"]; $body=$_POST["1st_Q"] . "\n". $_POST["2nd_Q1"] ."\n". $_POST["2nd_Q2"] ."\n". $_POST["3rd_Q1"] ."\n". $_POST["3rd_Q2"] ."\n". $_POST["3rd_Q3"] ."\n". $_POST["3rd_Q4"] ."\n". $_POST["3rd_Q5"] ."\n". $_POST["3rd_Q6"] ."\n". $_POST["4th_Q"] . "\n". $_POST["5th_Q"] . "\n". $_POST["6th_Q"] ."\n". $_POST["6th_Q2"] ."\n". $_POST["7th_Q"] . "\n". $_POST["Email"]; $to="Client@mailaddress.com"; $subject="Client Survey"; if (mail($to,$subject,$body,$from)) { ?> Quote Link to comment https://forums.phpfreaks.com/topic/107807-solved-forms-submitted-by-email/#findComment-552635 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.