Page 1 of 1

Input Structure

Posted: Thu Feb 28, 2008 8:34 am
by Snobbery08
Hey guys,

Need some help with structures of inputted text. I been making a forum for my site for a while now, but get problems with output of data.

When a user types a post in a structured way, the output of it after inserting it to the database and calling it back out to display in the forum looses it's structure.

A simple example would be say a user typed:
1)test
2)test
3)test


The output comes out:
1) test 2) test 3) test

Which is obviously not how the user wanted it to be....

How do you maintain text structure, either on the insert or on the echo? I am assuming its upon insert you save the structure with it some how? Hope you can help

Re: Input Structure

Posted: Thu Feb 28, 2008 8:40 am
by lepad
Have a look at http://php.net/nl2br

Re: Input Structure

Posted: Thu Feb 28, 2008 8:45 am
by Snobbery08
Thats what i used. But that inserts <br> and when the output goes through the BBCode function upon output which has nothing to do with <br>.......
The output becomes "1) test <br> 2) test <br> 3) test <br>"

What i did was i put it around the text before "insert to database" then again on the output... should i have it only on INSERT to the database or something?