| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
Senior Member
|
simple question
I have built a CMS for a client and when they enter text into a <textarea> and it's saved into a database, I can't get it to include any new lines saved when I output the text onto a page between <p> tags. Basically the user enters: Code:
and it spits out: Code:
How do I fix this? |
|
|
|
|
|
#2 (permalink) |
|
I ride polar bears
Join Date: Oct 2006
Location: the good part of Canada
Posts: 162
|
line break in textarea: "\n" line break in html: "<br />" if you look in the source, you should see the line breaks. use a string replacement function in php to replace "\n" with "<br />" in the output string. |
|
|
|
#5 (permalink) | |
|
Registered User
Join Date: Jun 2007
Location: Los Angeles
Posts: 33
|
Quote:
RalphF Domains & $4.99 Web Hosting Gold Rush Web Hosting - Domain Registration, Domain Names, Web Hosting |
|
|
![]() |