27 lines
586 B
PHP
27 lines
586 B
PHP
<?php
|
|
// required headers
|
|
header("Access-Control-Allow-Origin: *");
|
|
header("Content-Type: application/json; charset=UTF-8");
|
|
|
|
// include database and object files
|
|
include_once '../config/database.php';
|
|
include_once '../objects/score.php';
|
|
|
|
// instantiate database and score object
|
|
$db = new Database();
|
|
|
|
// initialize object
|
|
$score = new Score($db, "../../Scores/");
|
|
|
|
// read score will be here
|
|
// query scores
|
|
$scores_arr = $score->read_score_list();
|
|
|
|
// set response code - 200 OK
|
|
http_response_code(200);
|
|
|
|
// show scores data in json format
|
|
echo json_encode($scores_arr);
|
|
|
|
?>
|