This commit is contained in:
2019-07-11 12:50:54 +02:00
parent bc65070ce3
commit 7890bf2bcb
2 changed files with 3 additions and 23 deletions

16
uebung10/api.php Normal file
View File

@@ -0,0 +1,16 @@
<?php
require_once(__DIR__ . '/Database.php');
header('Content-Type: application/json');
$db = new Database();
$n = 0;
if (isset($_GET['n'])) {
$n = $_GET['n'];
}
$questions = $db->getQuestions($n);
$questionsobj = json_encode($questions);
echo($questionsobj);
?>