t

이미지가 있으면 보이고 없으면 안보이게 (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 ***** { ?>에서 '******'에 어떻게 넣어줘야 하는지요..??

댓글 2개

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

<? 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>
<? } ?>
댓글을 작성하시려면 로그인이 필요합니다.

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

+
제목 글쓴이 날짜 조회
10-07-03 조회 1,797
10-07-03 조회 1,751
10-07-03 조회 1,622
10-07-02 조회 1,845
10-07-02 조회 1,517
10-07-02 조회 2,466
10-07-02 조회 1,705
10-07-02 조회 1,483
10-07-02 조회 1,561
10-07-02 조회 1,518
10-07-02 조회 1,609
10-07-02 조회 2,619
10-07-02 조회 2,036
10-07-02 조회 1,267
10-07-02 조회 1,048
10-07-01 조회 1,270
10-07-01 조회 1,627
10-07-01 조회 2,928
10-07-01 조회 1,293
10-07-01 조회 1,452