add files
This commit is contained in:
28
db/add.php
Normal file
28
db/add.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
|
||||
include_once '../config/config.php';
|
||||
|
||||
$errors = [];
|
||||
$data = [];
|
||||
|
||||
|
||||
//Terminvorschlag 1 Prüfung ob zugesagter termin bereits belegt
|
||||
if (empty($_POST['vorname'])) {
|
||||
$errors['vorname'] = 'ID FEHLT!.';
|
||||
}
|
||||
|
||||
//$id = $_POST['id'];
|
||||
$sql = "INSERT INTO kunden (vorname, nachname, straße, ort, plz, telefonnummer, fahrzeuge) VALUES ('".$_POST['vorname']."', '".$_POST['nachname']."', '".$_POST['straße']."', '".$_POST['ort']."', '".$_POST['plz']."', '".$_POST['telefonnummer']."', '".$_POST['fahrzeuge']."' )";
|
||||
$db->query($sql);
|
||||
|
||||
$data['id'] = mysqli_insert_id($db);
|
||||
|
||||
$data['success'] = true;
|
||||
|
||||
echo json_encode($data);
|
||||
|
||||
|
||||
|
||||
|
||||
//echo json_encode($data);
|
||||
Reference in New Issue
Block a user