0

hi all,

IN my web site Users can put comments, Administrartor can view them and give permistion to print or not.

problem is when user put comments with out braking the lines. then comment will be printed in a single line and it wil
jumble the format of the site. beacuse a long comment go away from the right margin of the site.

here is the code of comment printing function

function printComments($postID){

    $qry="select * FROM usercomments  where postId='$postID'  order by commentId DESC";

    $result=mysql_query($qry) or die(mysql_error());

        while($row=mysql_fetch_array($result)){
                  if(!empty($row['commentId']) && $row['allow_cm']==1){


                                echo "<pre>"."<br>";
                                echo "<table border='1'>";
                                 echo "<tr>"."<td width='100px'>"."reply by :\t\t\t".'</td>'."<td width='100px'>".$row['name_cm'].'</td>'.'</tr>';
                                 echo "<tr>"."<td width='100px'>"."the message is:\t\t".'</td>'."<td width='100px'>".$row['comment_cm'].'</td>'.'</tr>';
                                 echo "<tr>"."<td width='100px'>"."date posted:\t\t\t".'</td>'."<td width='100px'>".$row['dateComment_cm'].'</td>'.'</tr>';
                                 //echo 'commentID'.$row['commentId'].'<br>';
                                // echo 'allow commetn'.$row['allow_cm'];
                                 echo "</table>";
                                 echo "<br>"."<br>"."<br>";
                             //  echo "ID".$row['id']."<$> ".$row['title']." ".$row['popst'];

                 // echo "varl is".$val1;

                   }

        }

}

can u help me to fix this.
you can get clear idea if u vist my site

www.sahansevena.co.cc/Blog.php

thanks in advance,
menuka.

2
Contributors
3
Replies
5
Views
6 Years
Discussion Span
Last Post by diafol
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.