I'd like to thank those who've responded to my first question but, unfortunately, I still have the same problem. Below is the code in question:
<?php
function PrintImage($image1, $image2, $image3)
{
$test=opendir(test);
switch($name)
{
case "one";
while (false !== ($file1=readdir($test)))
{
if($image1==$file1)
{
print("<img src=\"/test/$file1\">");
}
}
break;
case "two";
while (false !==($file2=readdir($test)))
{
if($image2==$file2)
{
print("<img src=\"/test/$file2\">");
}
}
break;
case "three";
while (false !==($file3=readdir($test)))
{
if($image3==$file3)
{
print("<img src=\"/test/$file3\">");
}
}
break;
}
closedir($test);
}
?>
<?php
PrintImage("PumpNeedle.gif", "PumpNozzle-Std.gif", "PumpNozzleScrew-HiFlow.gif");
?>
The killer is the code works perfectly until I turn it into a function. I can initialize the three $image variables with the file names and the code works. I have played around with creating simple functions that print values, then passing values to those functions and they work fine. Again, everything is great until I place the code inside the function.
Again, this is probably very simple and I'm just not seeing it. I do appreciate any help as my ability to create an online catalog for a customer is dependent upon solving this problem.