2022-10-27 12:35:35 +02:00
|
|
|
<?php
|
|
|
|
require_once('data.php');
|
|
|
|
|
|
|
|
|
|
|
|
$db = dbVerbindungErzeugen();
|
|
|
|
|
2022-11-14 16:27:53 +01:00
|
|
|
$lat = $_POST['lat'];
|
|
|
|
$lng = $_POST['lng'];
|
|
|
|
|
2022-10-27 12:35:35 +02:00
|
|
|
if(isset($_POST['titel'])){
|
|
|
|
$titel = $_POST['titel'];
|
|
|
|
}
|
2022-11-14 16:27:53 +01:00
|
|
|
if(isset($_POST['text'])){
|
|
|
|
$inhalt = $_POST['text'];
|
2022-10-27 12:35:35 +02:00
|
|
|
}
|
|
|
|
|
2023-01-03 16:08:52 +01:00
|
|
|
if(isset($_POST['adresse'])){
|
|
|
|
$adresse = $_POST['adresse'];
|
|
|
|
}
|
|
|
|
|
2022-11-15 16:03:28 +01:00
|
|
|
if(isset($_POST['bilder'])){
|
|
|
|
$bilder = $_POST['bilder'];
|
2022-11-18 15:11:18 +01:00
|
|
|
} else {
|
|
|
|
$bilder = NULL;
|
2022-11-15 16:03:28 +01:00
|
|
|
}
|
|
|
|
|
2023-01-03 16:08:52 +01:00
|
|
|
$sql = "INSERT INTO idee (titel, inhalt, koordinatenLat, koordinatenLng, bild, adresse) VALUES (?, ?, ?, ?, ?, ?)";
|
2022-10-27 12:35:35 +02:00
|
|
|
$stmt = $db->prepare($sql);
|
2023-01-03 16:08:52 +01:00
|
|
|
$stmt->execute(array($titel, $inhalt, $lat, $lng, $bilder, $adresse));
|
2022-11-15 16:03:28 +01:00
|
|
|
|
|
|
|
|
2022-10-27 12:35:35 +02:00
|
|
|
|
|
|
|
|
2022-11-15 14:59:24 +01:00
|
|
|
header("Location: /");
|
2022-11-14 16:27:53 +01:00
|
|
|
die();
|
2023-01-03 16:08:52 +01:00
|
|
|
?>
|