Example #1
0
    ?>
</h1>
		<p><?php 
    echo $article->get_content();
    ?>
</p>
	</article>
	<hr>
</section>

<section>
	<h3>Comment</h3>

	<?php 
    if (!empty($_POST)) {
        $article->add_comment($_POST['visitor_name'], $_POST['content']);
        echo 'Your comment has been sucessfully added';
        redirectTo('article.php?id=' . $_GET['id'], 2);
    }
    ?>

	<form action="" method="post">
		<input type="text" name="visitor_name" placeholder="your name">
		<br>
		<textarea name="content" placeholder="Content"></textarea>
		<br>
		<input type="submit">
	</form>
	<hr>
</section>