background 로 사용하는 방법좀 알려주세요 정보
background 로 사용하는 방법좀 알려주세요
본문
출처 : http://www.sir.co.kr/bbs/tb.php/g4_tiptech/5062
<?
switch($bo_table){
case "게시판이름1":
$boardTitle = "<img src={$g4['path']}/img/z.gif border=0>";
break;
case "게시판이름2":
$boardTitle = "<img src={$g4['path']}/img/z.gif border=0>";
break;
case "게시판이름3":
$boardTitle = "<img src={$g4['path']}/img/z.gif border=0>";
break;
case "게시판이름4":
$boardTitle = "<img src={$g4['path']}/img/z.gif border=0>";
break;
}
?>
출력할위치에
<?=$boardTitle?>
-----------------------------
이런식으로 사용하고 싶은데 이건 틀린방법이고
<table width='100%' border='0' cellspacing="0" cellpadding="0" background=<?=$boardTitle?>><tr><td>
어떻게 넣어야 하나요??
<?
switch($bo_table){
case "게시판이름1":
$boardTitle = "<img src={$g4['path']}/img/z.gif border=0>";
break;
case "게시판이름2":
$boardTitle = "<img src={$g4['path']}/img/z.gif border=0>";
break;
case "게시판이름3":
$boardTitle = "<img src={$g4['path']}/img/z.gif border=0>";
break;
case "게시판이름4":
$boardTitle = "<img src={$g4['path']}/img/z.gif border=0>";
break;
}
?>
출력할위치에
<?=$boardTitle?>
-----------------------------
이런식으로 사용하고 싶은데 이건 틀린방법이고
<table width='100%' border='0' cellspacing="0" cellpadding="0" background=<?=$boardTitle?>><tr><td>
어떻게 넣어야 하나요??
댓글 전체

이미지 넓이와 높이를 일정하게 하신다음
<table border='0' cellspacing="0" cellpadding="0">><tr><td background=<?=$boardTitle?> width='넓이' height='높이'></td></tr></table>
하시면 될듯하지 않을까요?
이미지 넓이와 높이가 일정하지 않다면....
$t_img=getimagesize($boardTitle);//이미지 사이즈 구하는 함수
$t_img[0] //이게 이미지 넓이가 되고여
$t_img[1] //이게 이미지 높이가 됩니다.
<table border='0' cellspacing="0" cellpadding="0">><tr><td background=<?=$boardTitle?> width='<?=$t_img[0]?>' height='<?=$t_img[1]?>'></td></tr></table>
<table border='0' cellspacing="0" cellpadding="0">><tr><td background=<?=$boardTitle?> width='넓이' height='높이'></td></tr></table>
하시면 될듯하지 않을까요?
이미지 넓이와 높이가 일정하지 않다면....
$t_img=getimagesize($boardTitle);//이미지 사이즈 구하는 함수
$t_img[0] //이게 이미지 넓이가 되고여
$t_img[1] //이게 이미지 높이가 됩니다.
<table border='0' cellspacing="0" cellpadding="0">><tr><td background=<?=$boardTitle?> width='<?=$t_img[0]?>' height='<?=$t_img[1]?>'></td></tr></table>
위에서 봤을때 값을 출력해보면
<table width='100%' border='0' cellspacing="0" cellpadding="0" background=<img src=이미지경로/img/z.gif border=0>> 이런 형식나오는데 이런형식은 못 봤습니다.
$boardTitle = "<img src={$g4['path']}/img/z.gif border=0>";
를
$boardTitle = "$g4[path]/img/z.gif"
로
바꾸셔야 겠네요
<table width='100%' border='0' cellspacing="0" cellpadding="0" background=<img src=이미지경로/img/z.gif border=0>> 이런 형식나오는데 이런형식은 못 봤습니다.
$boardTitle = "<img src={$g4['path']}/img/z.gif border=0>";
를
$boardTitle = "$g4[path]/img/z.gif"
로
바꾸셔야 겠네요

아 그렇구나 감사합니다~!