Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require '../conn.php';
- $json = file_get_contents('php://input');
- $values = json_decode($json, true);
- extract($values);
- $sql = "INSERT INTO users (name, weight) VALUES ('$name', '$weight')";
- if(!$conn->query($sql)){
- echo json_encode([
- 'error' => true
- ]);
- }else{
- echo json_encode([
- 'error' => false
- ]);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement