require 'functions.php'; $id = $_GET['id'] ?? ''; if ($id) { $relative_path = chunk_id($id); $absolute_path = "{$_SERVER['DOCUMENT_ROOT']}/public/pages/{$relative_path}/draft/"; $text = file_get_contents("{$absolute_path}page.json"); if ($text) { $response = (object) [ 'result' => [ 'body' => $text, ], 'status' => 200, 'statusText' => 'OK', ]; } } $data = json_decode($text); $content = $data->conteúdo; ?>