p17.10/php/post.php

14 lines
371 B
PHP

<?php
$con = mysqli_connect("192.168.80.31", "root", "secret", "db");
$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);
echo json_encode($kw);
?>