Forum Moderators: coopster

Message Too Old, No Replies

Extra line break in form email

         

steveinspain

7:36 am on May 24, 2005 (gmt 0)

10+ Year Member



Hi, I am using a php form and want an extra line break between the values in the resulting email
ie; instead of
name: Joe
phone: 33535533
I want
name: Joe

phone:33535533

This is the code from the form_action.php
$toAddress= $_POST['X_TO_EMAIL'];
$from= $_POST['X_FROM'];
$subject= $_POST['X_SUBJECT'];
$sentURL= $_POST['X_SENT_URL'];
$errorURL = $_POST['X_ERROR_URL'];
$fieldNames= $_POST['X_FIELD_NAMES'];
$fieldRequired= $_POST['X_FIELD_REQUIRED'];

$fieldNames= explode(".", $fieldNames);
$fieldRequired= explode(".", $fieldRequired);

$i = 0;

Anyone know how to do this?

mcibor

8:09 am on May 24, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It's no problem really. Usually the new line is just "\n\r", however under some operation systems (I'm unsure now if it's the linux or windows) the new line is just "\n"

So just try and write:

echo "Name: ".$name."\n\nphone: ".$phone."\n";

And that's it!

Michal CIbor

steveinspain

9:39 am on May 24, 2005 (gmt 0)

10+ Year Member



I've got it now.
Thanks Michal for your response

Steve