Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
- $messages[] = $row;
- $a++;
- if($a!==1){
- $b = "style='display:none;'";
- } else {
- $b = "";
- }
- echo "<hr><div class='homeBlog'>";
- echo "<a href='javascript:toggleDivFast(\"msg-".$a."\")'><h3 style='margin-left:30px;'>".$row['title']."</a></h3>";
- echo "<h5 style='margin-left:30px; margin-bottom:20px; margin-top:-15px;'>from ".$row['sender']."</h5>";
- echo "<div id='msg-".$a."' ".$b." ><p>".stripslashes($row['message'])."</p>";
- echo "<a href='javascript:toggleDivFast(\"homeComments-".$a."\")'><h4 style='margin-left:60px;'>Comments</h4></a>";
- echo '<div id="homeComments-'.$a.'" '.$b.'">';
- echo displayComments($row['id']);
- $id_cmt = $row['id'];
- $usr = $_SESSION['user'];
- echo '<div style="margin:40px;">';
- echo '<form action="post_comment.php" method="POST" name="cmtForm-'.$a.'">';
- echo '<textarea style="width:100%; height:100px;" name="msg" placeholder="Comment here">This is a test</textarea>';
- echo '<input type="hidden" value="'.$id_cmt.'" name="id_cmt" />';
- echo '<input type="hidden" value="'.$usr.'" name="usr" />';
- 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;" />';
- echo '</div></div></div></div>';
- }
Advertisement
Add Comment
Please, Sign In to add comment