2

최신리스트를 표시할때 폴더가 다른경우...

· 2012-05-14 (월) 16:24:13 · 861 · 1
include_once("./_common.php");
include_once("$g4[path]/lib/latest.lib.php");
echo latest("", "notice", 3, 23);

위에 코드를 이용해서

메인 index.php파일에 게시판의 최신글을 표시하려고합니다.

그런데..게시판이 설치된폴더는 public_html/board이고
index.php과 있는 폴더는 public_html/main/index.php 입니다.

그래서 index.php 파일을 다음과 같이 수정했습니다.


<?
include_once("$_SERVER[DOCUMENT_ROOT]/board/_common.php");
include_once("$_SERVER[DOCUMENT_ROOT]/board/lib/latest.lib.php");
echo latest("", "notice", 3, 23);
?>

그렇게 했더니..


Warning: include_once(./common.php) [function.include-once]: failed to open stream: No such file or directory in /home/hoho/public_html/board/_common.php on line 3

Warning: include_once() [function.include]: Failed opening './common.php' for inclusion (include_path='.:/usr/lib/php/pear') in /home/hoho/public_html/board/_common.php on line 3


이런 에러가 납니다. 어떻게 수정을 해야 제대로 돌아갈까요?
|

댓글 1개

인클루드는 맨 위 방법대로 하고
_common.php를 main폴더에 복사해 넣으세요
그리고 _common.php를 수정
$g4_path="../board";
댓글을 작성하시려면 로그인이 필요합니다.

그누4 질문답변

66,531건

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
12-05-14 조회 608
12-05-14 조회 1,246
12-05-14 조회 879
12-05-14 조회 793
12-05-14 조회 862
12-05-14 조회 884
12-05-14 조회 843
12-05-14 조회 1,650
12-05-14 조회 2,387
12-05-14 조회 877
12-05-14 조회 1,134
12-05-14 조회 1,212
12-05-14 조회 638
12-05-14 조회 1,618
12-05-14 조회 1,088
12-05-14 조회 975
12-05-14 조회 626
12-05-14 조회 1,060
12-05-14 조회 1,742
12-05-14 조회 784