36 lines
583 B
PHP
36 lines
583 B
PHP
<?php
|
|
require_once('data.php');
|
|
?>
|
|
|
|
|
|
<?php
|
|
|
|
$db = dbVerbindungErzeugen();
|
|
|
|
$lat = $_POST['lat'];
|
|
$lng = $_POST['lng'];
|
|
|
|
if(isset($_POST['titel'])){
|
|
$titel = $_POST['titel'];
|
|
}
|
|
if(isset($_POST['text'])){
|
|
$inhalt = $_POST['text'];
|
|
}
|
|
|
|
if(isset($_POST['bilder'])){
|
|
$bilder = $_POST['bilder'];
|
|
}
|
|
|
|
$sql = "INSERT INTO idee (titel, inhalt, koordinatenLat, koordinatenLng, bild) VALUES (?, ?, ?, ?, ?)";
|
|
$stmt = $db->prepare($sql);
|
|
$stmt->execute(array($titel, $inhalt, $lat, $lng, $bilder));
|
|
|
|
|
|
|
|
echo $db->lastInsertId();
|
|
|
|
header("Location: /");
|
|
die();
|
|
|
|
?>
|