I am trying to use an ID retrieved from the querystring to get a node from an xml file. I then need to extract each child node from that node into a variable. Here's my code:
<?php
$carid=$_GET['id'];
$xml = simplexml_load_file("xml/inventory.xml");
$car = $xml->xpath("/dataroot/XMLUpdateQuery[IDsuffix='$carid']");
$year = $car->xpath("YEAR");
$model = $car->xpath("MODEL");
$make = $car->xpath("MAKE");
$price = $car->xpath("ASKINGPRICE");
$color = $car->xpath("COLOR");
$comments = $car->xpath("COMMENTS");
$milesbeginning = $car->xpath("MILESBEGINNING");
?>
I know this isn't right, this just illustrates what I'm trying to do. Any help would be appreciated.