I\'m working on a block config/management system for my site using PHP & XML, and I\'ve got the following code which is supposed to generate the XML for each block in a specified column on the page.
In the index.php file.....
function piHandler($parser, $target, $data) {
switch (strtolower($target)) {
case \"php\":
eval($data);
break;
}
}
.....and in the xml file......
$left_blocks=mysql_query(\"SELECT * FROM blocks WHERE user=\'$user\' AND col=\'1\' ORDER BY pos\");
while($left_array=mysql_fetch_array($left_blocks)){
printf(\"<block disp_name=\\"%s\\" code_name=\\"%s\\">\n<disp_name>%s</disp_name>\n<type>small</type>\n<number>%s</number>\n<state>%s</state>\n<content>%s</content>\n</block>\n\n\", $left_array[disp_name],$left_array[code_name],$left_array[disp_name],$left_array[number],$left_array[state],$left_array[content]);
}
However, when I run it, I get the XML ouputted in the parsed HTML, so all I see on screen is \"table1 small 1 1 table2 small 2 1\". Is there a way round this so that the eval()\'d code remans in its original file (in this case index.xml)??