defining the path of an image dynamically
<p>I've created a simple fiunction, not sure whether I should be using a switch/case for the evaluation, but here goes. It should take the value of the field and determine which image its should use and then retuen the path of the image to the img tag. I've got my img tag below calling the function, any advice on what Im doing wrong?.</p>

<p>Many thanks</p>

<pre><code>function imgtype ($parameter) {
   if ($paramater) === "T") {$imgsrc = 'images/onetick.gif'; return $imgsrc;}
   elseif ($parameter === "TT") {$imgsrc = 'images/twotick.gif'; return $imgsrc;}
   elseif ($parameter === "X") {$imgsrc = 'images/cross.gif'; return $imgsrc;}
}
</code></pre>

<p>This is the tag that calls the function</p>

<pre><code>&lt;img width="29" height="19" src="&lt;?php imgtype($myRecord-&gt;getField('fieldvalue')); ?&gt;"&gt;
</code></pre>
