최신글 추출중에 오류 뜨는데요.
index.php에서 최신글 나올부분만
<?
include_once("./_common.php");
include_once("$g4[path]/lib/latest.lib.php"); // latest() 함수를 사용하여야 하므로 이 프로그램을 포함시킵니다.
echo latest("basic", "board01", 5, 70); // basic 스킨으로 free 라는 게시판을 출력합니다.
?>
이렇게 적었습니다.
확인해보니.
이런 오류가 ㅜㅜ
Warning: Cannot modify header information - headers already sent by (output started at /home3/piens2008/public_html/index.php:6) in /home3/piens2008/public_html/common.php on line 8
<?
include_once("./_common.php");
include_once("$g4[path]/lib/latest.lib.php"); // latest() 함수를 사용하여야 하므로 이 프로그램을 포함시킵니다.
echo latest("basic", "board01", 5, 70); // basic 스킨으로 free 라는 게시판을 출력합니다.
?>
이렇게 적었습니다.
확인해보니.
이런 오류가 ㅜㅜ
Warning: Cannot modify header information - headers already sent by (output started at /home3/piens2008/public_html/index.php:6) in /home3/piens2008/public_html/common.php on line 8
|
댓글을 작성하시려면 로그인이 필요합니다.
댓글 5개
이거 주석처리하시면 됩니다.
common.php 파일은 이미 상단에 인클루드 되어있을겁니다.
헤더관련 소스코드가 두번실행되서 생기는 오류입니다..
헤더는 파일의 최상단에 제일먼저 실행되도록 셋팅되어야 오류가 생기지 않습니다.
여기서 다음 내용은
<?php
include '_common.php'
는 파일 첫 글자부터 시작해야 합니다.
common.php 인클루드 전에 브라우저로 어떤 출력도 있어선 안됩니다.
공백이나 줄바꿈도 안됩니다.
<? 앞에 한칸띄어도 안됩니다.
쿠키도 헤더에 들어가는건 안되구요.
include_once("./_common.php");
include_once("$g4[path]/lib/latest.lib.php"); ?> 이부분을 php맨위에 넣고
<?echo latest("basic", "board01", 5, 70); // basic 스킨으로 free 라는 게시판을 출력합니다.
?>
이 부분은 최신글 넣을부분에 넣는거였네요; 간단한걸 ㅋㅋ