영

으 잘안되네여!!! 도와주세여ㅠ222

서브페이지를 만들고 있는데여

서브페이지는 sub>sub1-1.php파일이 잇는데요

요파일 안에 인클루드를 하려고해여 그런데www파일에 있는 _common,php파일을 인클루드하려는데
<?
include_once("../_common.php");
include_once("../lib/latest.lib.php");

$g4['title'] = "";
include_once("../_head.php");
?>

요런식으로 바꿔주는게 맞나요??
|

댓글 6개

sub 폴더면
<?
$g4_path = '..';
include_once("$g4_path/common.php");
include_once("$g4[path]/lib/liatest.lib.php");

이런식으로 선언해서 쓰세요!
고렇게변경하면


Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_user/zxcvb212/www/sub/sub1-1.php:3) in /home/hosting_user/zxcvb212/www/common.php on line 8

Warning: main(../lib/liatest.lib.php) [function.main]: failed to open stream: No such file or directory in /home/hosting_user/zxcvb212/www/sub/sub1-1.php on line 29

Warning: main() [function.include]: Failed opening '../lib/liatest.lib.php' for inclusion (include_path='.:/home/Product/php-4.4.7/lib/php') in /home/hosting_user/zxcvb212/www/sub/sub1-1.php on line 29
이런 에러가.. ㅠ떠요

서브페이지에 헤더랑 레프느 메뉴 인클루드하고픈데 잘안되네여...
먼저 sub디렉토리 안에 _common.php를 만들어서
$g4[path] = ".."; 라는 내용으로 저장하신 후

<?
include_once("./_common.php");
include_once("$g4[path]/lib/latest.lib.php");

$g4['title'] = "";
include_once("$g4[path]/_head.php");
?>

로 하시면됩니다.
말씀해주신데로 바꿔 봣는데요

Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_user/zxcvb212/www/sub/sub1-1.php:2) in /home/hosting_user/zxcvb212/www/common.php on line 8

Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_user/zxcvb212/www/sub/sub1-1.php:2) in /home/hosting_user/zxcvb212/www/head.sub.php on line 32

Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_user/zxcvb212/www/sub/sub1-1.php:2) in /home/hosting_user/zxcvb212/www/head.sub.php on line 34

Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_user/zxcvb212/www/sub/sub1-1.php:2) in /home/hosting_user/zxcvb212/www/head.sub.php on line 35

Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_user/zxcvb212/www/sub/sub1-1.php:2) in /home/hosting_user/zxcvb212/www/head.sub.php on line 36

Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_user/zxcvb212/www/sub/sub1-1.php:2) in /home/hosting_user/zxcvb212/www/head.sub.php on line 37

Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_user/zxcvb212/www/sub/sub1-1.php:2) in /home/hosting_user/zxcvb212/www/head.sub.php on line 38

요런식으로 또 뜨고말았어요ㅠㅠ
서브페이지 전용으로 인클루드파일 헤더레프트를 만들어 놓아야 하나요??
common위에는 공백이 있거나 내용이 들어가면 안됩니다.
if(!headers_sent())header(...); 헤더앞에 적어주니까 에러가 없어졌어요 !! ㅎㅎ
신경써서 답변주신거 감사합니다~
댓글을 작성하시려면 로그인이 필요합니다.

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

+
제목 글쓴이 날짜 조회
12-02-07 조회 1,016
12-02-07 조회 1,579
12-02-07 조회 1,918
12-02-07 조회 1,654
12-02-07 조회 2,117
12-02-07 조회 1,137
12-02-07 조회 1,745
12-02-07 조회 1,733
12-02-07 조회 1,710
12-02-07 조회 1,667
12-02-07 조회 1,355
12-02-07 조회 1,244
12-02-07 조회 888
12-02-07 조회 1,200
12-02-07 조회 1,678
12-02-07 조회 1,112
12-02-07 조회 1,077
12-02-07 조회 1,133
12-02-07 조회 1,674
12-02-07 조회 1,107