22 lines
662 B
PHP
22 lines
662 B
PHP
<?php
|
|
// include database and object files
|
|
include_once '../config/init.php'; // contains $db
|
|
include_once '../config/error.php';
|
|
include_once '../objects/db_session.php';
|
|
|
|
// prepare user object
|
|
$gameSession = new GameSession($db);
|
|
|
|
// read mandatory $_POST properties : ensure sessionId is passed in $_POST parameters
|
|
if (isset($_POST['sessionId']))
|
|
$gameSession->id = $_POST['sessionId'];
|
|
else trigger_error( missing_parameter_error("sessionId") );
|
|
|
|
// create the game session
|
|
if ($gameSession->load())
|
|
{
|
|
$session_arr = $gameSession->getResultArray(true, "Session_Found");
|
|
print_r(json_encode($session_arr)); // OK
|
|
}
|
|
else trigger_error("Error_Occured");
|
|
?>
|