false, 'error' => 'Invalid id']); exit; } $path = SCRIPTS_DIR . '/' . $id; if (!file_exists($path)) { echo json_encode(['ok' => false, 'error' => 'Not found']); exit; } echo json_encode(['ok' => true, 'content' => file_get_contents($path)]);