$bo_table 체크해서 맞는 이미지 보여주기 정보
$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 에 설정된 이미지만 나타나내요....
왜 이러나요?
댓글 전체

<?
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>
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
위 주소인데요 시간 되시면 한 번 봐주세요..
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>
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>

시간 내서 답변 주신점 감사합니다.^^
잘 됩니다.
잘 됩니다.