This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Run server: "php -S localhost:8888 api.php" | |
| // get the HTTP method, path and body of the request | |
| $method = $_SERVER['REQUEST_METHOD']; | |
| $request = explode('/', trim($_SERVER['PATH_INFO'],'/')); | |
| $input = json_decode(file_get_contents('php://input'),true); | |
| // connect to the mysql database |