36 lines
		
	
	
		
			667 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			36 lines
		
	
	
		
			667 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
require_once('data.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['adresse'])){
 | 
						|
    $adresse = $_POST['adresse'];
 | 
						|
  }
 | 
						|
 | 
						|
  if(isset($_POST['bilder'])){
 | 
						|
    $bilder = $_POST['bilder'];
 | 
						|
  } else {
 | 
						|
    $bilder = NULL;
 | 
						|
  }
 | 
						|
 | 
						|
$sql = "INSERT INTO idee (titel, inhalt, koordinatenLat, koordinatenLng, bild, adresse) VALUES (?, ?, ?, ?, ?, ?)";
 | 
						|
$stmt = $db->prepare($sql);
 | 
						|
$stmt->execute(array($titel, $inhalt, $lat, $lng, $bilder, $adresse));
 | 
						|
 | 
						|
 | 
						|
 | 
						|
 | 
						|
header("Location: /");
 | 
						|
die();
 | 
						|
?>
 |