Page 1 of 1

Text Area

Posted: Sun Apr 09, 2006 3:00 pm
by sampage
I have a simple User Brief input on my website.

However, when a user enters a brief, and for example hits return a couple of times...

like that, when I display the data on a page from the database the returned lines are ignored. Displaying the data back into a textarea they are still there.

How can I get round this with-out installing complicated WYSIWYG text inputs?

Posted: Sun Apr 09, 2006 3:05 pm
by AKA Panama Jack
Use the PHP function nl2br to display the text..

Code: Select all

echo nl2br($yourtextvariable);
That will convert all new lines to <br> so it will display properly.

Posted: Sun Apr 09, 2006 3:07 pm
by sampage
Thank you very much