get_parms('p', 'ses_id', 'usr_id', 'debug'); if (!$parm['debug']) { phrasea::headers(200, true, 'text/xml', 'UTF-8', false); } $sxParms = simplexml_load_string($parm['p']); $action = (string) $sxParms['action']; $dom = new DOMDocument('1.0', 'UTF-8'); $dom->preserveWhiteSpace = false; $dom->formatOutput = true; $result = $dom->appendChild($dom->createElement('result')); $result->setAttribute('action', $action); $status = 'OK'; $f = '_' . mb_strtolower($action) . '.php'; if (file_exists($f)) { include($f); } else { err('bad action'); } $result->appendChild($dom->createElement('status'))->appendChild($dom->createTextNode($status)); if ($parm['debug']) echo('
' . htmlentities($dom->saveXML()) . ''); else echo $dom->saveXML(); function err($msg) { global $dom, $result, $status; $result->appendChild($dom->createElement('err_msg'))->appendChild($dom->createTextNode($msg)); $status = 'ERR'; }