Reply to Re-inserting newlines

Your name:

Reply:


Posted by Philip Thompson on 11/09/32 11:19

Hi all.

I have searched for a way to figure out this problem, but nothing is
popping up. Here's the scenario:

I have a form which I will write to a database - so I escape the form
content. I have a <textarea></textarea> in the form. Obviously,
people can type whatever they want to in this textarea, including
newlines. Ok, I know how to escape the content to put it in the
database - but if there is an error on the page, I want to redirect
back to the page and correct their stuff.

So they have in one of the textareas:

--- start here ---
This is a line in the text area.

This is a line a couple of lines down in the text area.
--- end here ---

If I print the stuff back out to screen, it reads:

--- start here ---
This is a line in the text area.\r\n\r\nThis is a line a couple of
lines down in the text area.
--- end here ---

Anyone know how/what to replace the \r\n in the textarea to that it
shows up correctly with the actual newlines, not the \r\n???

Thanks in advance,
~Philip

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация