Guest User

Untitled

a guest
May 30th, 2013
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
  2.     $messages[] = $row;
  3.     $a++;
  4.    
  5.     if($a!==1){
  6.         $b = "style='display:none;'";
  7.     } else {
  8.         $b = "";
  9.     }
  10.    
  11.     echo "<hr><div class='homeBlog'>";
  12.     echo "<a href='javascript:toggleDivFast(\"msg-".$a."\")'><h3 style='margin-left:30px;'>".$row['title']."</a></h3>";
  13.     echo "<h5 style='margin-left:30px; margin-bottom:20px; margin-top:-15px;'>from ".$row['sender']."</h5>";
  14.     echo "<div id='msg-".$a."' ".$b." ><p>".stripslashes($row['message'])."</p>";
  15.    
  16.     echo "<a href='javascript:toggleDivFast(\"homeComments-".$a."\")'><h4 style='margin-left:60px;'>Comments</h4></a>";
  17.     echo '<div id="homeComments-'.$a.'" '.$b.'">';
  18.     echo displayComments($row['id']);
  19.    
  20.     $id_cmt = $row['id'];
  21.     $usr = $_SESSION['user'];
  22.    
  23.     echo '<div style="margin:40px;">';
  24.    
  25.     echo '<form action="post_comment.php" method="POST" name="cmtForm-'.$a.'">';
  26.     echo '<textarea style="width:100%; height:100px;" name="msg" placeholder="Comment here">This is a test</textarea>';
  27.     echo '<input type="hidden" value="'.$id_cmt.'" name="id_cmt" />';
  28.     echo '<input type="hidden" value="'.$usr.'" name="usr" />';
  29.     echo '<input type="submit" value="Add comment" style="margin:0; width:100%; height:25px; font-size:12px; color:black; text-shadow:none; font-family:\'roboto\', sans-serif;" />';
  30.     echo '</div></div></div></div>';       
  31. }
Advertisement
Add Comment
Please, Sign In to add comment