extract( $_POST );
$form_data=$_FILES['form_data']['tmp_name'];
$file = "$form_data";
function contents($parser, $data){
echo $data;
}
function startTag($parser, $data){
echo "<Name>";
}
function endTag($parser, $data){
echo "</Name>";
}
$xml_parser = xml_parser_create();
xml_set_element_handler($xml_parser, "startTag", "endTag");
xml_set_character_data_handler($xml_parser, "contents");
$fp = fopen($file, "r");
$data = fread($fp, 80000);
if(!(xml_parse($xml_parser, $data, feof($fp)))){
die("Error on line " . xml_get_current_line_number($xml_parser));
}
xml_parser_free($xml_parser);
fclose($fp);
This is the first thing I tried and it removes all the tags from the xml and shows all the data what I need is something to show just the name fields.
I also tried
<?php
extract( $_POST );
$form_data=$_FILES['form_data']['tmp_name'];
$xml = simplexml_load_file("$form_data");
echo $xml->getName() . "<br />";
foreach($xml->children() as $child)
{
echo $child->getName() . ": " . $child . "<br />";
}
?>
doesn't go deep enough into the xml It will show
Group
GroupId: 9223372036854844736
LeaderId: 214202457684634865
Type: 0
Assistants:
Parties: