p17.10/php/post.php

14 lines
371 B
PHP
Raw Permalink Normal View History

2024-10-10 12:07:01 +00:00
<?php
2024-10-10 13:04:12 +00:00
$con = mysqli_connect("192.168.80.31", "root", "secret", "db");
2024-10-10 13:14:09 +00:00
$data = json_decode(file_get_contents('php://input'), true);
2024-10-10 13:04:12 +00:00
$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);
echo json_encode($kw);
?>