echo "<p></p>"; } } function addComment($storyCreator, $replyTo) { echo "<form action=\"submit_comment.php\" method=\"POST\">"; echo "<input type=\"hidden\" name=\"token\" value=" . htmlspecialchars($_SESSION['token']) . ">"; echo "<p> Reply to:" . htmlspecialchars($replyTo) . "</p>"; echo "<p> <textarea name=\"commentContent\" rows = 10 ></textarea> </p>"; echo "<input type=\"hidden\" name=\"replyCommentTo\" value = " . htmlspecialchars($replyTo) . ">"; echo "<p> <input type=\"submit\" name=\"submitComment_button\" value=\"Submit\"> </p>"; echo "</form>"; } session_start(); $storyCreator = showStory(); showLink(); echo "<br><br><br><br>"; showComment(); if (isset($_SESSION['user_name'])) { if (isset($_POST["replyCommentButton"])) { $replyTo = htmlspecialchars($_POST["replyCommentTo"]); } elseif (isset($_POST["replyStoryButton"])) { $replyTo = htmlspecialchars($_POST["replyStory"]); } else { $replyTo = $storyCreator; } addComment($storyCreator, $replyTo); } else { echo "<br>log in to reply<br><br>"; } ?>
?> </li> <li><?php showLink("Historique"); ?> </li> <li><?php showLink("Informations"); ?> </li> <li><?php showLink("Inscription"); ?> </li> <li><?php showLink("Photos"); ?> </li> </ul> </div> <div id="sidebar"> <div id="horairetitle"><img src="calendrier.jpeg" height="30px"/></div> <div id="sidebarcontent"> <p class="sidebartitle">Horaires</p> <p class="whitetitle">Cours Adultes</p> <p class="horaires">Mar: 19h30 21h00</p> <p class="horaires">Jeu: 19h30 21h00</p> <p class="horaires">Sam: 09h30 12h00</p> <p class="whitetitle">Cours Enfants</p> <p class="horaires">Mer: 16h45 18h00</p>