묻고답하기

리디님 홈에 올린 질문입니다.
리디님 홈 : http://reedyfox.com/bbs/view.php?id=qna&page=1&sn1=&divpage=1&sn=off&ss=on&sc=on&select_arrange=headnum&desc=asc&no=840&read.html


바쁘신 것같아서 여기에 다시 질문을 올리니, 도와주시기 바랍니다.
+++++++++++++질문 내용+++++++++++++++
예를 들면, 홈페이지의 배경이든 테이블의 배경이든 아래처럼 쓰면 되는 것으로 알 고 있습니다.
<BODY background="그림주소">

<table background="그림주소">

이렇게 되면, 게시판이 달라지거나 메뉴가 달라질 때마다 새로운 주소나 새로운 그림 이름을 써줘야하는데....
물론 게시판 설정에서도 가능한 것으로 알고 있습니다만, 특정한 테이블의 경우는 제어하지 못해서요.
이게 아니라, 해당 게시판의 이름(id)에 따라 1개의 게시판에 body, table, td에 따라 다른 그림파일을 불러오는 것도
배경 그림을 다르게 가져올 수 있는 방법이 없을까요?

http://www.nzeo.com/bbs/zboard.php?id=cgi_tip&page=2&sn1=&divpage=1&sn=off&ss=on&sc=off&keyword=적용&select_arrange=headnum&desc=asc&no=4575
이 글을 리디님께서 올리셨길래 혹시 방법이 없을까해서 질문드립니다.

++++++++++++++++아래는 리디님 답변 내용++++++++++++++++++

<?php
switch ($id) {
case board1:
$bg_img = "bg1.gif";
$bg_img_td = "bg11.gif";
break;
case board2:
$bg_img = "bg2.gif";
$bg_img_td = "bg21.gif";
break;
case board3:
$bg_img = "bg3.gif";
$bg_img_td = "bg31.gif";
break;
default:
$bg_img = "bg4.gif";
$bg_img_td = "bg41.gif";
}
?>

<body background="http://주소/<?php echo $bg_img; ?>">
<td background="http://주소/<?php echo $bg_img_td; ?>">

++++++++++그래서 아래처럼 테스트 헤더파일을 만들었습니다.
<?
switch ($id) {
cmenu:
$bg_img_td1 = "green.jpg";
break;

}
?>


<html>
<HEAD>
<meta http-equiv=Content-Type content=text/html; charset=EUC-KR>
<link rel=StyleSheet HREF=2005renewal/menu2005.css title=style>
</HEAD>

<table border=1 cellspacing=0 cellpadding=0 width=100%>
<tr>
<td width=800 height=200 background="2005img/<?php echo $bg_img_td1; ?>"></td>
</tr>
<tr>
<td width=800> 보드 삽입

+++안되길래....

  1. 첫째

<?php
switch ($id) {
case cmenu:
$bg_img_td1="gren.jpg";
break;
}
?>

<html>
<HEAD>
<meta http-equiv=Content-Type content=text/html; charset=EUC-KR>
<link rel=StyleSheet HREF=2005renewal/menu2005.css title=style>
</HEAD>

<table border=1 cellspacing=0 cellpadding=0 width=100%>
<tr>
<td width=800 height=200 background="http://주소/2005img/<? php echo $bg_img_td1; ?>">

2. 두번째

<?php
switch ($id) {
case cmenu:
$bg_img_td1="gren.jpg";
break;
}
?>

<html>
<HEAD>
<meta http-equiv=Content-Type content=text/html; charset=EUC-KR>
<link rel=StyleSheet HREF=2005renewal/menu2005.css title=style>
</HEAD>

<table border=1 cellspacing=0 cellpadding=0 width=100%>
<tr>
<td width=800 height=200 background="http://주소/2005img/<? php echo "$bg_img_td1;" ?>">

3. 세 째
<?php
switch ($id) {
case cmenu:
$bg_img_td1="gren.jpg";
break;
}
?>

<html>
<HEAD>
<meta http-equiv=Content-Type content=text/html; charset=EUC-KR>
<link rel=StyleSheet HREF=2005renewal/menu2005.css title=style>
</HEAD>

<table border=1 cellspacing=0 cellpadding=0 width=100%>
<tr>
<td width=800 height=200 background=http://주소/2005img/<? php echo "$bg_img_td1;" ?>>

4. 네 째
<?
php
switch ($id) {
case cmenu:
$bg_img_td1="gren.jpg";
break;
}
?>

<html>
<HEAD>
<meta http-equiv=Content-Type content=text/html; charset=EUC-KR>
<link rel=StyleSheet HREF=2005renewal/menu2005.css title=style>
</HEAD>

<table border=1 cellspacing=0 cellpadding=0 width=100%>
<tr>
<td width=800 height=200 background="2005img/<? php echo $bg_img_td1; ?>">

===========이렇게 다 해보았는데도 안되네요....
http://www.archistory.org/bbs/zboard.php?id=cmenu
위의 주소처럼 나옵니다...

아무래도 헤더파일에 직접 php를 써서 그런 것같은데요...다른 방법은 없는지....

알려주시면 감사하겠습니다....
글쓴이 제목 최종 글
XE 공지 글 쓰기,삭제 운영방식 변경 공지 [16] 2019.03.05 by 남기남
김대일 소스가 있는데..풀이가..  
박한연 고수분들의 (혹은 경험많은) 의견을 알고자 합니다. . [1] 2007.08.10
まほろ mysql에서.. [1] 2007.08.10
さようなら 플레쉬 서브 메뉴 문제가 잇는데요 이해하기 쉽게 설명해주세요...  
정경진 우리집 컴퓨터에 웹폰트가 안보여요. [1] 2007.08.10
정원영 질문이요! 급해요. [1] 2007.08.10
HellDog 포샵 단축키에 관하여 [1] 2007.08.10
근사한홈피를갖고싶어 스타일 시트에 대해서 질문있어요 ~! [1] 2007.08.10
김대일 여기다 질문하는거 맞는지 모르겠지만... [1] 2007.08.10
나니 php if구문에 대해서 질문드립니다. [1] 2007.08.10
김정환 access DB 연결시 읽기전용이라는 오류 ㅜ.ㅜ...아시는분~  
윤여진 나야나 계정 쓰시는분들중 노프레임홈 만드신분 계신가요? [2] 2007.08.10
근사한홈피를갖고싶어 제발 아시는분 답변좀 부탁~!!!!!!!! [1] 2007.08.10
에리™ 공개자료실의 이영욱님 설문조사에 관해서...  
SuX 폼 태그에서 border-style 에는 solid말고 가장 기본적인게 뭐죠 ?? [2] 2007.08.10
김원녕 홈페이지 레이아웃에요.... [1] 2007.08.10
김원녕 DIV 태그.. [1] 2007.08.10
고영진 프레임 나눌때요!!! [1] 2007.08.10
지은사랑 ㅠ.ㅠ 제발 도와 주세요~~ 서버가.... [1] 2007.08.10
김한국 안녕하세요 서버상황및, 현재 멤버 리스트관련질문입니다.