$cattitle = "Showcase"; include_once("include.php"); // get the category to display from the URL // and clean it up $cat = str_replace("/","",$_SERVER['PATH_INFO']); $cat = str_replace(".","",$cat); if ($cat=='') { $cat = 'default'; } #$doc = domxml_open_file($xmlfile); $doc = simplexml_load_file($xmlfile); #$xpath = xpath_new_context($doc); $xpresult = $doc->xpath("//item[@showcase='yes']"); #$xpresult = xpath_eval($xpath, "//item[@showcase='yes']"); if (!$xpresult) { include("badcat.php"); } $item = $xpresult; $s = simplexml_import_dom($item); $xml = new SimpleXMLElement(file_get_contents($xmlfile)); $result = $xml->xpath("//item[@showcase='yes']"); foreach((array)$result as $key=>$node) { $code = (string)$node->code; $name = (string)$node->name; $key = (string)$node['key']; $new = (string)$node['new']; $cost = (string)$node->price; $description = $node->description; $items[$code]['new'] = $new; $items[$code]['sale'] = $node->sale; $items[$code]['name'] = $name; $items[$code]['key'] = $key; $items[$code]['exp'] = $node->exp; $items[$code]['code'] = $code; $items[$code]['cost'] = money_format("%i",$cost); $items[$code]['desc'] = $description; } //echo "
"; print_r($items);exit(); ?> include("header.php"); ?>include("footer.php"); ?>