spinn_mit/system/ideeSpeichern.php

30 lines
495 B
PHP
Raw Normal View History

<?php
require_once('data.php');
?>
<?php
$db = dbVerbindungErzeugen();
2022-11-14 16:27:53 +01:00
$lat = $_POST['lat'];
$lng = $_POST['lng'];
if(isset($_POST['titel'])){
$titel = $_POST['titel'];
}
2022-11-14 16:27:53 +01:00
if(isset($_POST['text'])){
$inhalt = $_POST['text'];
}
2022-11-14 16:27:53 +01:00
$sql = "INSERT INTO idee (titel, inhalt, koordinatenLat, koordinatenLng) VALUES (?, ?, ?, ?)";
$stmt = $db->prepare($sql);
2022-11-14 16:27:53 +01:00
$stmt->execute(array($titel, $inhalt, $lat, $lng));
echo $db->lastInsertId();
2022-11-15 14:59:24 +01:00
header("Location: /");
2022-11-14 16:27:53 +01:00
die();
?>