Quelques notes sur le php
https://eilgin.github.io/php-the-right-way/
https://www.codeofaninja.com/2017/02/create-simple-rest-api-in-php.html
https://www.leaseweb.com/labs/2015/10/creating-a-simple-rest-api-in-php/
https://www.w3schools.com/js/js_json_php.asp
<?php
if(isset($_POST['submit'])) { $name = $_POST['name']; $url = "http://localhost/projectname/api/".$name; $client = curl_init($url); curl_setopt($client,CURLOPT_RETURNTRANSFER,true); $response = curl_exec($client); $result = json_decode($response); echo $result->data; } ?>