figuringout Posted February 6, 2008 Share Posted February 6, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/89694-double-lines-spaces-from-form-output/ Share on other sites More sharing options...
Aureole Posted February 6, 2008 Share Posted February 6, 2008 I'm not really sure what's going on... try "\n" instead of "\r" maybe... Quote Link to comment https://forums.phpfreaks.com/topic/89694-double-lines-spaces-from-form-output/#findComment-459610 Share on other sites More sharing options...
figuringout Posted February 6, 2008 Author Share Posted February 6, 2008 I tried that already thanks. The email that gets sent is in plain text format, I'm not sure if that has a bearing on matters? Also, if I remove the "/r" then I get no returns at all, add it and I get two - bizarre Quote Link to comment https://forums.phpfreaks.com/topic/89694-double-lines-spaces-from-form-output/#findComment-459614 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.