이미지가 있으면 보이고 없으면 안보이게 (if문 질문) > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

이미지가 있으면 보이고 없으면 안보이게 (if문 질문) 정보

이미지가 있으면 보이고 없으면 안보이게 (if문 질문)

본문

<? if ***** { ?>
<td bgcolor="white" align=center>
<table>
<tr>
<td width=120 align=center>기타이미지2</td>
</tr>
<tr>
<td width=120 align=center><img src="<?=$img[5]?>" width="90" height="70" style='border:1 solid #cccccc;'></td>
</tr>
</table>
</td>
<? } ?>

여기서 이미지가 있으면 보이고 없으면 안보이게 처리하려 합니다. <? if ***** { ?>에서 '******'에 어떻게 넣어줘야 하는지요..??
  • 복사

댓글 전체

네... 그렇게 했는데 안되더라구요..

<? if ($img[5]) { ?>
<td bgcolor="white" align=center>
<table>
<tr>
<td width=120 align=center>기타이미지2</td>
</tr>
<tr>
<td width=120 align=center><img src="<?=$img[5]?>" width="90" height="70" style='border:1 solid #cccccc;'></td>
</tr>
</table>
</td>
<? } ?>

<? if ($img[6]) { ?>
<td bgcolor="white" align=center>
<table>
<tr>
<td width=120 align=center>기타이미지2</td>
</tr>
<tr>
<td width=120 align=center><img src="<?=$img[6]?>" width="90" height="70" style='border:1 solid #cccccc;'></td>
</tr>
</table>
</td>
<? } ?>
<? $is_img = $img[5]; ?>

<? if ($is_img) { ?>
<td bgcolor="white" align=center>
<table>
<tr>
<td width=120 align=center>기타이미지2</td>
</tr>
<tr>
<td width=120 align=center><img src="<?=$img[5]?>" width="90" height="70" style='border:1 solid #cccccc;'></td>
</tr>
</table>
</td>
<? } ?>
© SIRSOFT
현재 페이지 제일 처음으로