[RESOLVED] Insert linebreaks autmotically when posting?

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
LuiePL
Forum Commoner
Posts: 40
Joined: Fri Aug 04, 2006 11:38 pm

[RESOLVED] Insert linebreaks autmotically when posting?

Post by LuiePL »

I'm looking to setup an article submission page for my members. Kind of along the same theory as the backend of phpBB2 and other forums. The admins will "activate" the submissions after they proofread them. However, I don't want people to have to type the HTML code themselves within the article to get linebreaks to work. When you hit "ENTER" in any forums, like this one, it stores it in the database, and when read, it does it backwards (has the linebreaks set) too.

So does anyone know of the command I would use, or function I would have to create to get it to work? I hope my question makes sense. Thanks for the help.
Last edited by LuiePL on Thu Aug 17, 2006 7:45 pm, edited 1 time in total.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

nl2br() is your friend.
LuiePL
Forum Commoner
Posts: 40
Joined: Fri Aug 04, 2006 11:38 pm

Post by LuiePL »

Indeed! Thanks!
Post Reply