-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathevents.php
More file actions
49 lines (37 loc) · 1.38 KB
/
Copy pathevents.php
File metadata and controls
49 lines (37 loc) · 1.38 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
require_once './db_connection.php'; ?>
<style> <?php include './form.css';?> </style>
<?php
if (isset($_POST['submit'])){
$stmtNameEvent = $pdo->prepare(
'INSERT INTO events (name, description,start_time,end_time)
VALUES (:name,:description,:start_time,:end_time)');
$stmtNameEvent->execute([
'name' => $_POST['name-event'],
'description' => $_POST['description-event'],
'start_time' => $_POST['start-event'],
'end_time' => $_POST['end-event'],
]);
}
?>
<form action="events.php" method="post">
<label for="name-event">Add new event
<br><input type="text" name="name-event" placeholder="Write the name of the event"><br><br>
</label>
<label for="description-event">Description of the event
<br><textarea name="description-event" placeholder="Write a description of the event"></textarea><br><br>
</label>
<label for="start-event">Start time of the event
<br><input type="datetime-local" name="start-event"><br><br>
</label>
<label for="end-event">End time of the event
<br><input type="datetime-local" name="end-event"><br><br>
</label>
<input id="submit_id" type="submit" name="submit" value="submit"><br><br>
</form>
<div>
<p><a href="index.php"> Go to sign in </a></p>
</div>
<div>
<p><a href="user-list.php">Go to list of users >></a></p>
</div>