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="Client@mailaddress.com";

$subject="Client Survey";

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

?>

 

 

Any help is greatly appreciated.

Link to comment
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="Client@mailaddress.com";
$subject="Client Survey";
if (mail($to,$subject,$body,$from)) {
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.