There are two cases possible:
1. Store already HTML-formatted text in db. Then you do nothing
before sending it to the screen; never use nl2br() here!
2. Store plain text, may be with a simpliest tags like b, i, u,
ol, ul, li, a, img. Then put it through the nl2br() function
before outputting to browser.
It's easy for the editor that will update news on the site. So she
can, for example, copy text from Word document into the form's
<textarea> in natural paragraphs, & in browser it will look the
same, without need to insert <br> or <p> for paragraph formatting.
Just select which one is more suitable for u.
Monday, July 23, 2001, 2:37:15 PM, Geoffrey Makstutis <[EMAIL PROTECTED]> wrote:
GM> Hi,
GM> I'm getting a problem when I pull text from a mySQL database. The text is froma
GM> varchar field and contains some HTML tags. New lines are translated to <BR>, but
GM> when the field is outputted, anything coming after an HTML tag loses its
formatting
GM> (ie. no line breaks converted to <BR>).
GM> Can anyone suggest a solution?
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]