개가죽

$bo_table 체크해서 맞는 이미지 보여주기

· 2008-02-17 (일) 17:06:32 · 2096 · 4
일단 코드는

<?
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>
시간 내서 답변 주신점 감사합니다.^^
잘 됩니다.
댓글을 작성하시려면 로그인이 필요합니다.

그누4 질문답변

66,531건

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

+
제목 글쓴이 날짜 조회
08-02-18 조회 1,620
08-02-18 조회 1,627
08-02-17 조회 1,708
08-02-17 조회 1,634
08-02-17 조회 1,642
08-02-17 조회 1,635
08-02-17 조회 1,676
08-02-17 조회 2,004
08-02-17 조회 1,717
08-02-17 조회 1,641
08-02-17 조회 2,097
08-02-17 조회 1,625
08-02-17 조회 1,621
08-02-17 조회 1,628
08-02-17 조회 1,984
08-02-17 조회 2,031
08-02-17 조회 1,632
08-02-17 조회 2,291
08-02-17 조회 1,424
08-02-17 조회 1,999