All pastes #735750 Raw Edit

Unnamed

public text v1 · immutable
#735750 ·published 2007-10-13 22:22 UTC
rendered paste body
<?
$field_list = parse_product_template($template_id, $pid, $cust_id, 3);
//print_r($field_list);
echo "<Product><br>\n";
echo "<ProductName>".$pname."</ProductName><br>\n";
echo "<ProductNumber>".$pid."</ProductNumber><br>\n";
foreach ($field_list as $field) {
	echo "<".$field.">";
	echo $field[1];
	//var_dump($_POST[$field[0]]);
	var_dump($field);
	//echo $_POST['VP'];
	echo "</".$field."><br>\n";
}
echo "</Product><br>\n";
?>

//function//
	//fid == 3 for parsing the form data.
	if ($fid == 3) {
		$xml = new SimpleXMLElement($template);
		//define the array
		$form_fields = array();
		foreach ($xml->xpath('//Product[ProductNum = '.$pid.']/question') as $question) {
			array_push($form_fields, $question['name']);
		} //end foreach
		return $form_fields;
	} // end of fid == 3
}