?php $file = "xmltest.xml"; function trustedFile($file) {/ / only trust local files owned by ourselves if (!eregi("^([a-z]+): / /", $file) fileowner($file) == getmyuid()) {return true;} return false;} function startElement($parser, $name, $attribs) {print" lt; font color=\"#0000cc\ "$name / font"; if (sizeof($attribs)) {while (list($k, $v) = each($attribs)) {print "font color=\"#009900\" $k / font =\ "font color=\"#990000\" $v / font \"";}} print "gt ;";} function endElement($parser, $name) {print" lt; / font color=\"#0000cc\ "$name / font gt ;";} function characterData($parser, $data) {print" b $data / b ";} function PIHandler($parser, $target, $data) {switch (strtolower($target)) {case "php": global $parser_file; / / If the parsed document is "trusted", we say it is safe / / to execute PHP code inside it.
?php $file = "xmltest.xml"; function trustedFile($file) {/ / only trust local files owned by ourselves if (!eregi("^([a-z]+): / /", $file) fileowner($file) == getmyuid()) {return TRUE;} return FALSE;} function startElement($parser, $name, $attribs) {print" lt; font color=\"#0000cc\ "$name / font"; if (sizeof($attribs)) {while (list($k, $v) = each($attribs)) {print "font color=\"#009900\" $k / font =\ "font color=\"#990000\" $v / font \"";}} print "gt ;";} function endElement($parser, $name) {print" lt; / font color=\"#0000cc\ "$name / font gt ;";} function characterData($parser, $data) {print" B $data / B ";} function PIHandler($parser, $target, $data) {switch (strtolower($target)) {case "php": global $parser_file; / / If the parsed document is "trusted", we say it is safe / / to execute PHP code inside it.