제가 적용한 방법입니다. 정보
답변 제가 적용한 방법입니다.
본문
방법은 의외로 간단합니다.
단 하나의 파일만 만들면 됩니다.
index.html을 만들어 아래 소스로 저장하면 끝납니다.
============== index.html 소스시작 (예제입니다. 여러분 환경에 맞도록 수정하시면 됩니다.) ==============
<?
switch($p) // p는 물음표 뒤에 붙이는 문자.
{
case "comm_":
include "common.php";//반드시 들어가야 함
include "head.sub.php";
include "html/comm.php";//실제로 불러올 파일
include "tail.sub.php";
break;
case "comm":
include "common.php";//반드시 들어가야 함
include "head.sub.php";
include "head.php";
include "html/comm.php";//실제로 불러올 파일
include "tail.php";
include "tail.sub.php";
break;
case "pds":
include "common.php";//반드시 들어가야 함
include "head.sub.php";
include "head.php";
include "html/pds.php";//실제로 불러올 파일
include "tail.php";
include "tail.sub.php";
break;
case "dabsa":
include "common.php";//반드시 들어가야 함
include "head.sub.php";
include "head.php";
include "html/dabsa.php";//실제로 불러올 파일
include "tail.php";
include "tail.sub.php";
break;
default:
include "index.php"; // index
}
?>
========================== 소스 끝 ===============
불러올때는
http://g4설치경로/?p=comm
http://g4설치경로/?p=pds
http://g4설치경로/?p=dabsa
이런식으로 case에 정의내린 그대로 불러오면 됩니다.
그리고 불러올 파일에는 그냥 내용만 입력하면 됩니다.
인클루드니 뭐니 이런거 필요 없습니다.
그냥 보여주고자 하는 내용만 입력하세요.
이런 자료가 제로보드에 있더군요.
거참~~~!
단 하나의 파일만 만들면 됩니다.
index.html을 만들어 아래 소스로 저장하면 끝납니다.
============== index.html 소스시작 (예제입니다. 여러분 환경에 맞도록 수정하시면 됩니다.) ==============
<?
switch($p) // p는 물음표 뒤에 붙이는 문자.
{
case "comm_":
include "common.php";//반드시 들어가야 함
include "head.sub.php";
include "html/comm.php";//실제로 불러올 파일
include "tail.sub.php";
break;
case "comm":
include "common.php";//반드시 들어가야 함
include "head.sub.php";
include "head.php";
include "html/comm.php";//실제로 불러올 파일
include "tail.php";
include "tail.sub.php";
break;
case "pds":
include "common.php";//반드시 들어가야 함
include "head.sub.php";
include "head.php";
include "html/pds.php";//실제로 불러올 파일
include "tail.php";
include "tail.sub.php";
break;
case "dabsa":
include "common.php";//반드시 들어가야 함
include "head.sub.php";
include "head.php";
include "html/dabsa.php";//실제로 불러올 파일
include "tail.php";
include "tail.sub.php";
break;
default:
include "index.php"; // index
}
?>
========================== 소스 끝 ===============
불러올때는
http://g4설치경로/?p=comm
http://g4설치경로/?p=pds
http://g4설치경로/?p=dabsa
이런식으로 case에 정의내린 그대로 불러오면 됩니다.
그리고 불러올 파일에는 그냥 내용만 입력하면 됩니다.
인클루드니 뭐니 이런거 필요 없습니다.
그냥 보여주고자 하는 내용만 입력하세요.
이런 자료가 제로보드에 있더군요.
거참~~~!
댓글 전체
우와~~ 좋은 방법입니다..^^
저도 사용해봐야겠습니다..^^
저도 사용해봐야겠습니다..^^