-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOpdracht3-7.php
35 lines (33 loc) · 933 Bytes
/
Opdracht3-7.php
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
31
32
33
34
35
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>PHP</title>
</head>
<body>
<?php
$public = "N";
if (isset($_POST['submit'])) {
if (empty($_POST['sender']) || empty($_POST['message'])){
echo "Fill in all the fields";
}
else {
include "inc_connect.php";
$db_table = "zodiacfeedback";
$date = date("Y-m-d");
$time = date("H:i:s");
$sender = $_POST['sender'];
$message = $_POST['message'];
if (isset($_POST['public'])){
$public = $_POST['public'];
}
// INSERT INTO $TableName VALUES('DATE HIER', 'TIME HIER', '$_POST["sender"]', '$_POST["message"]', '$_POST["public"]')
$query = "INSERT INTO $db_table VALUES ('$date', '$time', '$sender', '$message', '$public')";
mysqli_query($DBConnect, $query);
echo "<h2>Thanks for entering a message.</h2>";
echo "<a href='Opdracht3-8.php'>view results</a>";
}
}
?>
</body>
</html>