-
NO Display on empty
Code:
if (!empty($display_lgimage3))
echo "<a href=\"$URL/enc/resize.php?image=$URL/$imgname3&width=$lgimgwidth&height=lgimgheight\" rel=\"lightbox\">";
echo "<img src=\"$URL/enc/resize.php?image=$URL/$imgname3&height=$smimgheight&width=$smimgwidth\" title=\"$display_item\" border=\"0\">
I'm a PHP novice, but all I am trying to accomplish is to have NOTHING display ed when $dispay_lgimage3 is empty. As it stands, the above displays the square & red "x" in it.
I'm sure it's a quick fix, I just can't figure it. I tried putting an "else" statement but that just wrought havoc. ;) Thanks!
-
Because there are two lines of code intended to be within the if block, you'll need to wrap them with curly braces.
Code:
if (!empty($display_lgimage3)) {
echo "<a href=\"$URL/enc/resize.php?image=$URL/$imgname3&width=$lgimgwidth&height=lgimgheight\" rel=\"lightbox\">";
echo "<img src=\"$URL/enc/resize.php?image=$URL/$imgname3&height=$smimgheight&width=$smimgwidth\" title=\"$display_item\" border=\"0\">";
}
-