영

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

· 2012-02-07 (화) 16:35:43 · 1665 · 6
서브페이지를 만들고 있는데여

서브페이지는 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");

이런식으로 선언해서 쓰세요!
2012-02-07 (화) 16:58:35
고렇게변경하면


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");
?>

로 하시면됩니다.
2012-02-07 (화) 17:18:28
말씀해주신데로 바꿔 봣는데요

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위에는 공백이 있거나 내용이 들어가면 안됩니다.
2012-02-07 (화) 19:49:11
if(!headers_sent())header(...); 헤더앞에 적어주니까 에러가 없어졌어요 !! ㅎㅎ
신경써서 답변주신거 감사합니다~
댓글을 작성하시려면 로그인이 필요합니다.

그누4 질문답변

66,531건

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

+
제목 글쓴이 날짜 조회
12-02-07 조회 1,010
12-02-07 조회 1,570
12-02-07 조회 1,911
12-02-07 조회 1,645
12-02-07 조회 2,107
12-02-07 조회 1,130
12-02-07 조회 1,740
12-02-07 조회 1,725
12-02-07 조회 1,704
12-02-07 조회 1,658
12-02-07 조회 1,348
12-02-07 조회 1,238
12-02-07 조회 883
12-02-07 조회 1,192
12-02-07 조회 1,672
12-02-07 조회 1,103
12-02-07 조회 1,071
12-02-07 조회 1,125
12-02-07 조회 1,666
12-02-07 조회 1,098