Jump to content


Photo

Forum Formatting Help?


  • Please log in to reply
3 replies to this topic

#1 DaVuLf

DaVuLf
  • Members
  • PipPipPip
  • Advanced Member
  • 124 posts

Posted 28 August 2006 - 09:16 PM

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

#2 hitman6003

hitman6003
  • Members
  • PipPipPip
  • Advanced Member
  • 1,807 posts

Posted 28 August 2006 - 09:39 PM

either
echo "<pre>" . $text . "</pre>";
tags around the text, or use the nl2br function.

http://www.php.net/nl2br

#3 DaVuLf

DaVuLf
  • Members
  • PipPipPip
  • Advanced Member
  • 124 posts

Posted 28 August 2006 - 10:51 PM

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.

#4 hitman6003

hitman6003
  • Members
  • PipPipPip
  • Advanced Member
  • 1,807 posts

Posted 28 August 2006 - 10:55 PM

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users