PDA

View Full Version : Keeping Formatting from Forms to DB


BoogityBean
7-26-04, 07:42 PM
I am not sure how to put this, but lets see if anyone gets the meaning of what I'm trying to do.

I am wanting to put a blog on my site and wanting to know how I would keep the formatting of the paragraphs without adding <BR> or <P> to the posts to keep the way it was typed after it is outputted from the database.

-------------------------------------------
Example: I put in the text area of the form

This is paragraph 1

and this is paragraph 2

Though I receive when I try to output:

This is paragraph 1and this is paragraph 2

----------------------------------------------

I've tried using the <pre> tags with it, but when I have a set width of a table, it keeps the formatting too well and pushes the table further out without doing any word wraps.

Pig
7-26-04, 08:05 PM
you need nl2br();

BoogityBean
7-26-04, 11:11 PM
Thanks! You really helped me out!