= 8192) { // Max length, probably even longer, definitely no data we want http_response_code(413); // "Payload too large" exit; } $xp = new XmlParser(); $load_ok = $xp->loadXmlFromString($input_xml); if (!$load_ok) { // XML could not be parsed - invalid or no XML http_response_code(406); // "Not acceptable" exit; } if (!$xp->validateGOTU()) { // No root node or root node isn't , so no update XML http_response_code(412); // "Precondition failed" exit; } // ### At this point we can be relatively sure to have the XML we want echo "Input length is " . strlen($input_xml) . " Bytes." . PHP_EOL; #echo $input_xml . PHP_EOL; // TODO: Check if it's XML // If so: Store a copy for re-parsing (or to print out and hang up on a wall) // Then parse XML into database exit; } echo "Here is the normal page. " . $_SERVER['REQUEST_METHOD']; // TODO: Show statistics from database