Jump to content

Double lines spaces from form output


figuringout

Recommended Posts

I am a complete novice and this is really bugging me.

I have a form written in PHP that gets populated from a MySQL database. The form displays an address from the database that looks good in the form - each line has a single break after it.

However when I post the form and email the values using mail() each line comes out with double returns i.e Instead of just one return after each line I have two.

 

PHP:

<textarea id='CustomerDetails' name='CustomerDetails' rows='12' cols='50'>
<?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 0, '', "\r"); ?>
<?php echo "\r" . $order->customer['telephone']; ?>
<?php echo "\r" . $order->customer['email_address']; ?>
</textarea>

 

I post these to another php file that builds up some other details and sends an email.

 

$emaildata = $_POST[CustomerDetails] ;

mail($recipient,$subject,$message,$headers);

 

The email returned has two "\r" between every line, I'd like just one. I've also tried "\l" both output double line spaces. I attempted "<br />" also but this just outputs the character as a string in the form and in the email.

Link to comment
https://forums.phpfreaks.com/topic/89694-double-lines-spaces-from-form-output/
Share on other sites

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.