Re: fixing new lines from <textarea> in an email?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jun 26, 2009 at 12:27, Adam Williams<awilliam@xxxxxxxxxxxxxxxx> wrote:
> I have staff fill out a form that contains a <textarea> with their problem
> description and emailed to me when they click submit.  Staff will press
> enter in the text area, but I'm having problems converting the \r\n into a
> new line in the email that is sent to me, here is the code:
[snip!]


    In a cursory glance, I've noticed the following code:

htmlspecialchars(nl2br(str_replace('\r','',$_POST["problem"])))

    You are using a literal '\r' in your str_replace() function.  This
should instead be replaced with double quotes to translate the \r to
its appropriate EOL character:

htmlspecialchars(nl2br(str_replace("\r",'',$_POST["problem"])))

-- 
</Daniel P. Brown>
daniel.brown@xxxxxxxxxxxx || danbrown@xxxxxxx
http://www.parasane.net/ || http://www.pilotpig.net/
Ask me about our fully-managed servers and proactive management
clusters starting at just $200/mo.!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux