newB- filling in the list menu with xml results
Posted: Wed Sep 06, 2006 7:01 am
i have the following xml parser that works fine for my xml file....
i would like to fill the values/labels of a dropdown list menu with the results...At present, with my limited knowledge, i get all the values into the first element of the list menu....how can i make these results list appropriately?
my list box in html:
Code: Select all
<?php
$path="../html/";
$file="data.xml";
$absolute=$path.$file;
$data=file_get_contents($absolute);
$xmlData = new SimpleXMLElement($data);
//SimpleXMLElement Object ( [Row] => Array ( [0] => SimpleXMLElement Object ( [Cell] => SimpleXMLElement Object ( [Data] => Guest Employee ) )
//MUST remove ss: form xml file
foreach($xmlData->Row as $leader){
$eachLeader=$leader->Cell->Data;
echo($eachLeader);
}
?>my list box in html:
Code: Select all
<select name="leader" id="leader" tabindex="1">
<option value="<?php include "getNames.php"; ?>"><?php include "getNames.php";?></option>
</select></td>