thanks John, I will give that a shot.

-----Original Message-----
From: CPT John W. Holmes [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 11, 2003 4:18 PM
To: Edward Peloke; [EMAIL PROTECTED] Php. Net
Subject: Re: [PHP] nl2br


> I am trying to create a very basic page where we can all easily work on a
> document.  I just have a huge textarea that inserts the text into a
longtext
> field in the mysql db.  I use nl2br to keep the formatting.  Of course,
when
> the document is viewed in the textarea, all of the <br /> are there.  THe
> problem is, everytime I update the text in the textarea, another set of
<br
> />'s are put in so with every edit, the lines get farther and farther
> apart...why?

So stop using nl2br() on the data before you put it in the database. You
only use nl2br() when it's displayed on a webpage as HTML. If you're
displaying the data in a textarea, you should be running htmlentities() on
it before you put it between <textarea> and </textarea> tags.

---John Holmes...


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

Reply via email to