답변 4개 / 댓글 6개
채택된 답변
+20 포인트
그누보드가 설치된 루트에 sub.php를 만들어줍니다.
Copy
<?php
include_once('./_common.php');
$pageType = $_GET['pageType'];
include_once('./_head.php');
if (!$pageType) {
$pageType = "01";
}
if ($pageType == "01") {
include($_SERVER['DOCUMENT_ROOT'].'/theme/daontheme_business12/html/company/01.php');
}elseif ($pageType == "02") {
include($_SERVER['DOCUMENT_ROOT'].'/theme/daontheme_business12/html/company/02.php');
}elseif ($pageType == "03") {
include($_SERVER['DOCUMENT_ROOT'].'/theme/daontheme_business12/html/company/03.php');
}elseif ($pageType == "04") {
include($_SERVER['DOCUMENT_ROOT'].'/theme/daontheme_business12/html/company/04.php');
}elseif ($pageType == "05") {
include($_SERVER['DOCUMENT_ROOT'].'/theme/daontheme_business12/html/company/05.php');
}else {
goto_url(G5_URL);
}
include_once('./_tail.php');
?>
이렇게 파라미터만 갈아끼워서 불러오는 방법이 있습니다.
example.com/sub.php?pageType=01 이런 형태로 불러올 수 있습니다.
$_SERVER['DOCUMENT_ROOT'] 말고 G5_THEME_URL 같이 경로 상수 사용하셔도 되며, 서버 환경에 맞게 사용하세용
답변에 대한 댓글 3개
이경로에 /theme/daontheme_business12/html/company/02.php
/theme/daontheme_business12/html/company/03php
/theme/daontheme_business12/html/company/04.php
header.php
tail.php
이렇게 있습니다. 여기서 말씀 주신 head tail 관련 include는 지우는게 편하다는말씀이 위에 각 php 파일 안에 내용 삭제를 말씀 하시는 거죠 ??
~~
/theme/daontheme_business12/html/company/03php
/theme/daontheme_business12/html/company/04.php
header.php
tail.php
이렇게 있습니다. 여기서 말씀 주신 head tail 관련 include는 지우는게 편하다는말씀이 위에 각 php 파일 안에 내용 삭제를 말씀 하시는 거죠 ??
~~
일단 적인 그누경로로 하면 아래 처럼 하시면 될텐데 어떻게 사용을 하실려는건지 좀더 자세히 적으셔야 도움을 받으실수 있으실거 같습니다.
답변에 대한 댓글 1개
답변을 작성하려면 로그인이 필요합니다.