Forum Moderators: coopster
<? $status = recordsetname(field);
?>
<?
if ($status == "0" {
echo "<img src="img/status0.gif" />";
} else {
echo "<img src="img/status1.gif" />";
}
?>
I am unsure of using HTML in an echo command. I dont know if it works or not. But that is essentially what i have on my page. When I go to load it in a browser... nothing comes up. But I have tried every thing. Its probably something dumb with a space or a quotation. But if there is a better way to do this... all help is appreciated. Thanks in advance.
<? $status = recordsetname(field);
?>
for the next part there are a couple of things. If $status is actually a number then you don't need quotes around the 0. You also have some quote mismatches. As you have variables to be resolved inside your img tags then just use single quotes around the outside. It is also missing a ) in your if
<?
if ($status == 0) {
echo '<img src="img/status0.gif" />';
} else {
echo '<img src="img/status1.gif" />';
}
?>
about quoting strings
[php.net...]