DaVuLf Posted August 28, 2006 Share Posted August 28, 2006 Hey there. I just had a question about the way a forum displays formatting. Currently I've got a TextArea input field (similar to this field here I'd assume) and it seems to store properly in my mySQL table, but when I output the field, it loses all of the formatting, and so looks jumbled together. Is there any way to make it show something as if i had the php or code wrapper on it that can be found in many forums?Thanks,DaVuLF Quote Link to comment Share on other sites More sharing options...
hitman6003 Posted August 28, 2006 Share Posted August 28, 2006 either [code]echo "<pre>" . $text . "</pre>";[/code] tags around the text, or use the nl2br function.http://www.php.net/nl2br Quote Link to comment Share on other sites More sharing options...
DaVuLf Posted August 28, 2006 Author Share Posted August 28, 2006 I'm using echo... I have a query that gets the result from the database, and then echoes (or prints) the result. This is done without formatting. I will look at the link you provided. Quote Link to comment Share on other sites More sharing options...
hitman6003 Posted August 28, 2006 Share Posted August 28, 2006 Hmmm, the forum removed the pre tags that I put in...anyway...it is supposed to say to put < pre > and < /pre > around the text. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.