-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcomment.php
More file actions
30 lines (28 loc) · 736 Bytes
/
comment.php
File metadata and controls
30 lines (28 loc) · 736 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<html>
<?php
require 'head.php';
?>
<body>
<?php
require 'navbar.php';
$commentdata = $_POST['comment'];
$projectid = $_POST['projectid'];
$user_name = $_SESSION['email'];
?>
<div id="main-content" class="container">
<h2 class="text-center menu-title">Projects</h2>
<div id="menu-item">
<h3 class="menu-item-title"><?php echo $projectid;
echo $commentdata; ?></h3>
<?php
$sqlcomment = "INSERT INTO projectcomments values (".$projectid.", '".$user_name."', '".$commentdata."', now())";
if ($conn->query($sqlcomment) === TRUE) {
echo "Congratulations!! Your comment has been created successfully.";
} else {
echo "Error: <br>" . $conn->error;
}
?>
</div>
</div>
</body>
</html>