forked from if-itb/IF3110-01-Simple-Blog
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadd_comment.php
More file actions
17 lines (17 loc) · 721 Bytes
/
add_comment.php
File metadata and controls
17 lines (17 loc) · 721 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php
$postid = $_POST["postid"];
$nama = $_POST["nama"];
$email = $_POST["email"];
$komen = $_POST["komen"];
mysql_connect("localhost","root","");
@mysql_select_db("simpleblog") or die( "Unable to select database");
$query = "INSERT INTO comment (idpost,nama,email,komentar) Values (".$postid.",\"".$nama."\",\"".$email."\",\"".$komen."\");";
mysql_query($query);
echo '<li class="art-list-item">
<div class="art-list-item-title-and-time">
<h2 class="art-list-title"><a href="post.html">'.$nama.'</a></h2>
<div class="art-list-time">0 menit lalu</div>
</div>
<p>'.$komen.'</p>
</li>';
?>