php post added

This commit is contained in:
mpabi 2024-10-10 14:07:01 +02:00
parent ca363fed78
commit 19265c6358
1 changed files with 14 additions and 0 deletions

14
php/post.php Normal file
View File

@ -0,0 +1,14 @@
<?php
$polaczenie = mysqli_connect("172.19.0.3", "root", "secret", "bazqq");
$imie = $_POST['imie'];
$nazwisko = $_POST['nazwisko'];
$email = $_POST['email'];
$photo = $_FILES['photo']['tmp_name'];
$photoContent = null;
if (is_uploaded_file($photo)) {
$photoContent = addslashes(file_get_contents($photo));
}
$kwerenda = "INSERT INTO dane (imie, nazwisko, email, photo) VALUES ('$imie', '$nazwisko', '$email', '$photoContent')";
mysqli_query($polaczenie, $kwerenda);
echo json_encode($response);
?>