-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocess.php
More file actions
30 lines (22 loc) · 805 Bytes
/
process.php
File metadata and controls
30 lines (22 loc) · 805 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
<?php
if(!isset($_GET['name']) || $_GET['name'] == "") {
die('Error no name provided');
}else{
$name = $_GET['name'];
}
if(!isset($_GET['comment']) || $_GET['comment'] == "") {
die('Error no message provided');
}else{
$message = $_GET['comment'];
}
// Connect to database
include("dbconn.php");
$date = date("Y-m-d H:i:s"); // gets exact time
// inserts data into datatable
$stmp = $mysqli->prepare("INSERT INTO `commentsGroup` (`name`, `message`, `date`) VALUES (?,?,?);");
// sets the values in the table
$stmp->bind_param("sss", $_GET['name'], $_GET['comment'], $date);
$stmp->execute(); // executes
$mysqli->close(); // closes
header('location: comments.php');
?>