회원호스팅-네트워크 자원 공유 서비스 :: 진보네트워크센터

진보넷   회원 호스팅

작성자
에띠
제목
주소/?channel=about식으로 만들기
작성일
2003.04.02 00:45:14
조회수
9,157
추천
0
문서 주소
http://hosting.jinbo.net/webbs/view.php?board=manual&id=63
두가지 방법이 있습니다..

첫번째 방법
먼저 인덱스파일을 아래와 같이 함수화 시켜주시고요,
'channel' 폴더를 새로만듭니다.

<?
switch($channel)
{
case "community":
include "channel/community.php";
break;
case "news":
include "channel/news.php";
break;
case "pds":
include "channel/pds.php";
break;
default:
include "index_1.html"; // index
}
?>
default:
include "index_1.html";
은 홈피 메인이고,
case "community":
include "channel/community.php";
break;
은 채널입니다.
channel 폴더안에는 community.php 등등을 올려야겠죠...

두번째 방법은
아주 간단한 방법이면서 약간의 위험성을 감수한 방법이긴 한데..

<?php

if (eregi("/", $_GET["channel"])) die("보안 경고_-");

include $_GET[channel].".php";

?>
</pre>
이와 같이 해주는 방법이 있습니다..
채널식으로 해주면 뭐가 좋아지냐고 물어보실 분이 계실것 같아서
약간 답변을 미리 드리면
우선 보기가 좋잖아영 (ㅡ,.-)
http://hosting.jinbo.net/manual/maybbs/index.php 보다는
http://hosting.jinbo.net/?manual=main 요렇게 하면 주소도 줄어들고
암튼 어쨋든 뭔가 있어보이구요...노프레임으로 홈피를 제작할때 아주 유용하게 쓰여질 수 있을 겁니다..