Hi,
I have the following code that creates a hidden form on a page. All the user sees is the image, that just looks like a regular link, but that will feed all the relevant data into the new page to display the results.
function form_to_print($postto, $target, $fieldsarray, $Image)
{
//dynamically build hidden forms with button links to records
echo "<form action=\"$postto\" target=\"$target\" method=\"post\">";
foreach ($fieldsarray as $item)
{
$name = $item["name"];
$value = $item["value"];
echo "<input type=\"hidden\" name=\"$name\" value=\"$value\">";
}
echo "<input type=\"image\" border=\"0\" name=\"submit\" src=\"$Image\">";
echo "</form>";
}
$fieldsarray = array (
array (name => "chassis", value => "$chassis"),
array (name => "productlevel", value => "$productlevel"),
array (name => "status", value => "$status"),
array (name => "originator", value => "$originator"),
array (name => "assignedto", value => "$assignedto"),
array (name => "area", value => "$area"),
array (name => "drrank", value => "$drrank"),
array (name => "datefrom", value => "$datefrom"),
array (name => "dateto", value => "$dateto")
);
form_to_print("ViewHWProbs.php", "_blank", "$fieldsarray", "/Images/newprintable.gif");
But I keep getting the error message:
Warning: Invalid argument supplied for foreach() in z:/joannew_view/cm_pds_src/htdocs/OutputFns.php on line 322
I don't get it, can anyone see what's worng??