I'm writing a little web app to display the top ten viruses as reported by Trend Micro. I want to have a small color coded icon appear next to each virus to represent it's risk factor (gray = low, yellow = medium, red = high). Each virus's risk factor is stored in an array callled $risk. I want the loop to assign the appropriate icon for the risk factor. However, the loop always returns blank.gif for the icon. The only time blank.gif should be returned is if there is no risk factor recorded for the virus. Here's the code:
Code: Select all
<?php
$j = 0;
while ($j <= 9) {
if ($riskї$j] == "low") {
$statusї$j] = "images/gray.gif";
} elseif ($riskї$j] == "medium") {
$statusї$j] = "images/yellow.gif";
} elseif ($riskї$j] == "high") {
$statusї$j] = "images/red.gif";
} else {
$statusї$j] = "images/blank.gif";
}
$j++;
}
?>Thank in advance,
AUaero