<?php echo 'dhgcd'; include_once __DIR__ . '/../api/Api.php'; // Requests from the same server don't have a HTTP_ORIGIN header if (!array_key_exists('HTTP_ORIGIN', $_SERVER)) { $_SERVER['HTTP_ORIGIN'] = $_SERVER['SERVER_NAME']; } try { var_dump($_REQUEST); $api = new Api($_REQUEST['request'], $_SERVER['HTTP_ORIGIN']); echo $api->processAPI(); if (isset($conn)) { mysqli_close($conn); } } catch (Exception $e) { echo json_encode(array('error' => $e->getMessage())); if (isset($conn)) { mysqli_close($conn); } }
<?php require_once 'Api.php'; ini_set('display_errors', 'On'); error_reporting(E_ALL | E_STRICT); try { if (!array_key_exists('request', $_REQUEST)) { return; } $cur_api = new Api($_REQUEST['request']); echo $cur_api->processAPI() . "\n"; } catch (Exception $e) { echo json_encode(array('error' => $e->getMessage())); }