post
This commit is contained in:
parent
fe5c465031
commit
89a894432e
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
$con = mysqli_connect("localhost", "root", "", "baza1");
|
||||
$lastname = $_POST['Lastname'];
|
||||
$firstname = $_POST['Firstname'];
|
||||
$mail = $_POST['mail'];
|
||||
$sub = $_POST['sub'];
|
||||
$path = $_POST['path'];
|
||||
|
||||
$query = "INSERT INTO persons (LastName, FirstName, Email, Subject, Path) VALUES ('$lastname', '$firstname', '$mail', '$sub', '$path')";
|
||||
|
||||
if (mysqli_query($con, $query)) {
|
||||
$response = array('status' => 'success');
|
||||
} else {
|
||||
$response = array('status' => 'error', 'message' => mysqli_error($con)); // Provide error details
|
||||
}
|
||||
|
||||
echo json_encode($response);
|
||||
|
||||
$con->close();
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue