Input Structure

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Snobbery08
Forum Newbie
Posts: 13
Joined: Sun Jan 06, 2008 10:45 am

Input Structure

Post 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
lepad
Forum Newbie
Posts: 12
Joined: Fri Oct 05, 2007 9:58 am

Re: Input Structure

Post by lepad »

Have a look at http://php.net/nl2br
Snobbery08
Forum Newbie
Posts: 13
Joined: Sun Jan 06, 2008 10:45 am

Re: Input Structure

Post 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?
Post Reply