$bo_table 체크해서 맞는 이미지 보여주기
일단 코드는
<?
if ($bo_table == "notic" ){
echo "<img src=<?=$g4[path]?>/img/common/communityTitle1.gif width=349 height=35 />";
} else if ($bo_table == "freeBoard" ){
echo "<img src=<?=$g4[path]?>/img/common/communityTitle2.gif width=349 height=35 />";
}
?>
<table width="<?=$widthTable?>" cellpadding="0" cellspacing="0" align="center">
<tr>
<td><img src="<?=$g4[path]?>/img/common/leftMenuTitle05.png" width="200" height="59" /></td>
<td align="right"><? echo "<img src={$g4[path]}/img/common/communityTitle{$bo_table}.gif width=349 height=35 />"; ?></td>
</tr>
</table>
위와 같이 짰습니다.
코드 보시면 아시겠지만 $bo_table = "notic" // 게시판 아이디가 notic 라면
communityTitle1.gif 이미지를 보여주고
$bo_table = "freeBoard" // 게시판 아이디가 freeBoard 라면
communityTitle2.gif 이미지를 보여주라는 코드인데요...
이게 notic 에 설정된 이미지만 나타나내요....
왜 이러나요?
<?
if ($bo_table == "notic" ){
echo "<img src=<?=$g4[path]?>/img/common/communityTitle1.gif width=349 height=35 />";
} else if ($bo_table == "freeBoard" ){
echo "<img src=<?=$g4[path]?>/img/common/communityTitle2.gif width=349 height=35 />";
}
?>
<table width="<?=$widthTable?>" cellpadding="0" cellspacing="0" align="center">
<tr>
<td><img src="<?=$g4[path]?>/img/common/leftMenuTitle05.png" width="200" height="59" /></td>
<td align="right"><? echo "<img src={$g4[path]}/img/common/communityTitle{$bo_table}.gif width=349 height=35 />"; ?></td>
</tr>
</table>
위와 같이 짰습니다.
코드 보시면 아시겠지만 $bo_table = "notic" // 게시판 아이디가 notic 라면
communityTitle1.gif 이미지를 보여주고
$bo_table = "freeBoard" // 게시판 아이디가 freeBoard 라면
communityTitle2.gif 이미지를 보여주라는 코드인데요...
이게 notic 에 설정된 이미지만 나타나내요....
왜 이러나요?
|
댓글을 작성하시려면 로그인이 필요합니다.
로그인
댓글 4개
if ($bo_table == "notic" ){
$table_img = "<img src=<?=$g4[path]?>/img/common/communityTitle1.gif width=349 height=35 />";
} else if ($bo_table == "freeBoard" ){
$table_img = "<img src=<?=$g4[path]?>/img/common/communityTitle2.gif width=349 height=35 />";
}
?>
<table width="<?=$widthTable?>" cellpadding="0" cellspacing="0" align="center">
<tr>
<td><img src="<?=$g4[path]?>/img/common/leftMenuTitle05.png" width="200" height="59" /></td>
<td align="right"><? echo "<img src={$g4[path]}/img/common/communityTitle{$table_img}.gif width=349 height=35 />"; ?></td>
</tr>
</table>
http://jejudom.com/bbs/board.php?bo_table=notic
위 주소인데요 시간 되시면 한 번 봐주세요..
if ($bo_table == 'notic'){
$img = "<img src='{$g4['path']}/img/common/communityTitle1.gif' width='349' height='35'>";
} else if ($bo_table == 'freeBoard'){
$img = "<img src='{$g4['path']}/img/common/communityTitle2.gif' width='349' height='35'>";
} else {
$img = "이미지 없음";
}
?>
<table width="<?=$widthTable?>" cellpadding="0" cellspacing="0" align="center">
<tr>
<td><img src="<?=$g4['path']?>/img/common/leftMenuTitle05.png" width="200" height="59" /></td>
<td align="right"><?=$img?></td>
</tr>
</table>
잘 됩니다.