From 530d1ae8ec207df899b3b57a5bd749e5e4ce5e94 Mon Sep 17 00:00:00 2001 From: mpabi Date: Thu, 10 Oct 2024 15:14:09 +0200 Subject: [PATCH] post update --- php/post.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/php/post.php b/php/post.php index dfb227c..65fb5b0 100644 --- a/php/post.php +++ b/php/post.php @@ -2,8 +2,7 @@ $con = mysqli_connect("192.168.80.31", "root", "secret", "db"); -$rawData = file_get_contents('php://input'); -$data = json_decode($rawData, true); +$data = json_decode(file_get_contents('php://input'), true); $kw = "INSERT INTO Persons (LastName, FirstName, Email, Subject, Path) VALUES ('{$data['ln']}', '{$data['fn']}', '{$data['email']}', '{$data['subject']}', '{$data['path']}')"; $ans = mysqli_query($con, $kw);