Formulare hinzugefügt
This commit is contained in:
20
formulare/submit.php
Executable file
20
formulare/submit.php
Executable file
@@ -0,0 +1,20 @@
|
||||
<?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]);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user