Jump to content

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

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.