Solved

Restoring fomat of textarea submission before email via php

Posted on 2008-06-22
2
278 Views
Last Modified: 2008-06-29
I have a simple form submitted that includes a textarea.  If the user adds multiple carriage returns to open up white space in the submission, I need to preserve that formatting when the script recieves it via post and processes it for email to me.

Right now, php removes all the line breaks and new lines and sends me the concatenated paragraph.
The name of the textarea is "message" and so I am attempting to access it through $_REQUESTmessage].  But all the newlines and returns are already removed from that variable.  

I've tried to find this answer everywhere, please help.
0
Comment
Question by:marcimhof
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 28

Accepted Solution

by:
gamebits earned 50 total points
ID: 21842481
$message = nl2br($_rEQUEST['message']);
0
 

Author Comment

by:marcimhof
ID: 21842512
That does put the <br> into the string the required numebr of times to preserve it on the browser.

So, now if I want to send $message t othe function to send the email, it will have <br> insterad of the \r\n which would be better if sending a completely text email correct?

Before I send it, should I replace al lthe <br> with \r\n ?
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question