으 잘안되네여!!! 도와주세여ㅠ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 질문답변

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

+
제목 글쓴이 날짜 조회
13년 전 조회 1,521
13년 전 조회 1,223
13년 전 조회 1,100
13년 전 조회 765
13년 전 조회 1,048
13년 전 조회 1,531
13년 전 조회 957
13년 전 조회 951
13년 전 조회 993
13년 전 조회 1,549
13년 전 조회 975
13년 전 조회 890
13년 전 조회 948
13년 전 조회 1,542
13년 전 조회 1,610
13년 전 조회 1,549
13년 전 조회 2,332
13년 전 조회 1,559
13년 전 조회 953
13년 전 조회 1,557
🐛 버그신고