-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadd.php
More file actions
29 lines (19 loc) · 691 Bytes
/
add.php
File metadata and controls
29 lines (19 loc) · 691 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
<?php
session_start();
if ($_SESSION['user']=='inloggad'){
$Rubrik = $_POST['Rubrik'];
$Event = $_POST['Event'];
$Datum = $_POST['Datum'];
$Info = $_POST['Info'];
if ($Datum == NULL){
$Datum="0000-00-00";
}
$db=mysqli_connect('localhost', '***', '***', "***") or die('Error connecting to database server');
$db -> set_charset("utf8");
$query = "INSERT INTO forening (rubrik, tillStallning, datum, Info) VALUES ('$Rubrik', '$Event', '$Datum', '$Info')";
$result = mysqli_query($db,$query) or die('Kunde inte läsa från tabellen');
mysqli_close($db);
header("Location: test.php");
exit;
}
?>