How to show text from DB with <breaks>?
Posted: Tue Oct 10, 2006 6:44 pm
Hey guys,
Basically, I wrote a small custom forum program and I'm having problems getting the text to display properly. Obviously, when I get the text from the DB, the HTML outputs it in a straight line because it reads a space and every consecutive space after that as nothing.
One option was the <pre></pre> tags, but this is still a pain as it messes with the text cosmetics. The solution to that would be putting the <font></font> tage inside the <pre></pre> tag but the text is still one size bigger (I get a size 4 when I put a size 3) in IE.
Also using the <pre></pre> tags I'm forced to hack every line off after 70 columns or so using wordwrap().
The text is being sent to my server with the breaks intact (using <textarea name="message" cols="60" rows="20" id="message" wrap="virtual">), so I'm completely out of ideas.
I'm sure there's a really simple solution to this and I'm just really complicating things. If anyone has any ideas, let me know.
Thanks,
Dimitri Marshall
P.S. I would just install PHPBB but it's more than I need and I really don't feel like customizing it to the look and feel of my web site. I think solving this issue would be a lot easier, not to mention I like writting my own stuff to learn.
Basically, I wrote a small custom forum program and I'm having problems getting the text to display properly. Obviously, when I get the text from the DB, the HTML outputs it in a straight line because it reads a space and every consecutive space after that as nothing.
One option was the <pre></pre> tags, but this is still a pain as it messes with the text cosmetics. The solution to that would be putting the <font></font> tage inside the <pre></pre> tag but the text is still one size bigger (I get a size 4 when I put a size 3) in IE.
Also using the <pre></pre> tags I'm forced to hack every line off after 70 columns or so using wordwrap().
The text is being sent to my server with the breaks intact (using <textarea name="message" cols="60" rows="20" id="message" wrap="virtual">), so I'm completely out of ideas.
I'm sure there's a really simple solution to this and I'm just really complicating things. If anyone has any ideas, let me know.
Thanks,
Dimitri Marshall
P.S. I would just install PHPBB but it's more than I need and I really don't feel like customizing it to the look and feel of my web site. I think solving this issue would be a lot easier, not to mention I like writting my own stuff to learn.