Page 1 of 1

Textbox Database Storage Problem!

Posted: Mon Feb 23, 2004 3:21 am
by bumple
Hi all,

I currently have a blog website I made for fun...

I store users information in databases, but when I want to store a textbox, similar to the one I am filling out right now for this post, in a database, it saves the text without returns...just commonplace, ugly text. Is there any way I can have a dynamic textbox, similar to that on Yahoo! mail, where users can choose to bolden text, italicize, and where the textbox will save the returns in the database, instead of just one straight line?

Thanks in advance!
-BUMPle.

Posted: Mon Feb 23, 2004 4:06 am
by markl999
The database will have the newlines, you just can't see them. To get them back out of the db and show them on a web page run the text through nl2br() first, Eg echo nl2br($thetext);

If you want all the bold, italics stuff you mentioned then you can either just have the user enter html codes or use a bbcode style textarea, search google for that as i'm sure there's loads around.