21 lines
678 B
PHP
Executable File
21 lines
678 B
PHP
Executable File
<?php
|
|
header("Access-Control-Allow-Origin: *");
|
|
include("../../mysqlverbinden.php");
|
|
|
|
if(!isset($_POST["internalformid"])) die("POST internalformid fehlt");
|
|
$formid=$_POST["internalformid"];
|
|
print_r($_POST);
|
|
mysqli_execute_query($db_id,"INSERT INTO `formulare-ergebnisse` (`formular`) VALUES (?);",[$formid]);
|
|
$id = mysqli_insert_id($db_id);
|
|
echo $id;
|
|
|
|
foreach($_POST as $key => $value){
|
|
if($key=="internalformid") continue;
|
|
if(is_array($value)){
|
|
$value=json_encode($value,JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES);
|
|
$key.="[]";
|
|
}
|
|
mysqli_execute_query($db_id,"INSERT INTO `formulare-ergebnis` (`name`, `value`,`ergebnisid`) VALUES (?,?,?);",[$key,$value,$id]);
|
|
|
|
}
|