Jump to content

PHP displaying formatted text.


newtothis19

Recommended Posts

Hello everyone, I have a problem hope you can help.

I'm using a forum (phpbb) but I want to bring the information from the forum onto a php web page. But when I do it doesn't come out formatted, just as a lump of text. Now I found <pre> tags on google searching for an answer and that works in formatting the text with paragraphs and stuff. But when the text string hits the end of the table, instead of going to the next line it strenches the table and the page out. Leaving me with a big H scroll and no way to fix it.

Any ideas on what I need to do to make it format properly? here's a peice of the coding:

$result2 = mysql_query("SELECT * FROM phpbb_posts_text WHERE post_id='$post' LIMIT 1");
while ($row = mysql_fetch_array($result2))
{
$subject=$row["post_subject"];
$body=$row["post_text"];
echo "<b>",$subject,":</b><pre width='100'>",$body,"</pre>";
}

Thanks
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.