Jump to content

[SOLVED] Forms submitted by email.


imagfinder

Recommended Posts

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="[email protected]";

$subject="Client Survey";

if (mail($to,$subject,$body,$from)) {

?>

 

 

Any help is greatly appreciated.

Link to comment
https://forums.phpfreaks.com/topic/107807-solved-forms-submitted-by-email/
Share on other sites

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="[email protected]";
$subject="Client Survey";
if (mail($to,$subject,$body,$from)) {
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.