오류문구좀 봐주세요.ㅠ 정보
오류문구좀 봐주세요.ㅠ본문
홈페이지에 아래와 같은 오류 문구가 뜹니다.
--------------------------------------------------------------------------------------------------------
Warning: Cannot modify header information - headers already sent by (output started at /home1/dietchoi/public_html/head.php:2) in /home1/dietchoi/public_html/head.sub.php on line 4
Warning: Cannot modify header information - headers already sent by (output started at /home1/dietchoi/public_html/head.php:2) in /home1/dietchoi/public_html/head.sub.php on line 6
Warning: Cannot modify header information - headers already sent by (output started at /home1/dietchoi/public_html/head.php:2) in /home1/dietchoi/public_html/head.sub.php on line 7
Warning: Cannot modify header information - headers already sent by (output started at /home1/dietchoi/public_html/head.php:2) in /home1/dietchoi/public_html/head.sub.php on line 8
Warning: Cannot modify header information - headers already sent by (output started at /home1/dietchoi/public_html/head.php:2) in /home1/dietchoi/public_html/head.sub.php on line 9
Warning: Cannot modify header information - headers already sent by (output started at /home1/dietchoi/public_html/head.php:2) in /home1/dietchoi/public_html/head.sub.php on line 10
--------------------------------------------------------------------------------------------------------
Warning: Cannot modify header information - headers already sent by (output started at /home1/dietchoi/public_html/head.php:2) in /home1/dietchoi/public_html/head.sub.php on line 6
Warning: Cannot modify header information - headers already sent by (output started at /home1/dietchoi/public_html/head.php:2) in /home1/dietchoi/public_html/head.sub.php on line 7
Warning: Cannot modify header information - headers already sent by (output started at /home1/dietchoi/public_html/head.php:2) in /home1/dietchoi/public_html/head.sub.php on line 8
Warning: Cannot modify header information - headers already sent by (output started at /home1/dietchoi/public_html/head.php:2) in /home1/dietchoi/public_html/head.sub.php on line 9
Warning: Cannot modify header information - headers already sent by (output started at /home1/dietchoi/public_html/head.php:2) in /home1/dietchoi/public_html/head.sub.php on line 10
--------------------------------------------------------------------------------------------------------
head.sub.php를 열어서 오류 줄수의 내용은 아래와 같습니다.
--------------------------------------------------------------------------------------------------------
// 자바스크립트에서 go(-1) 함수를 쓰면 폼값이 사라질때 해당 폼의 상단에 사용하면
// 캐쉬의 내용을 가져옴. 완전한지는 검증되지 않음
header("Content-Type: text/html; charset=$g4[charset]");
$gmnow = gmdate("D, d M Y H:i:s") . " GMT";
header("Expires: 0"); // rfc2616 - Section 14.21
header("Last-Modified: " . $gmnow);
header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
header("Cache-Control: pre-check=0, post-check=0, max-age=0"); // HTTP/1.1
header("Pragma: no-cache"); // HTTP/1.0
// 캐쉬의 내용을 가져옴. 완전한지는 검증되지 않음
header("Content-Type: text/html; charset=$g4[charset]");
$gmnow = gmdate("D, d M Y H:i:s") . " GMT";
header("Expires: 0"); // rfc2616 - Section 14.21
header("Last-Modified: " . $gmnow);
header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
header("Cache-Control: pre-check=0, post-check=0, max-age=0"); // HTTP/1.1
header("Pragma: no-cache"); // HTTP/1.0
--------------------------------------------------------------------------------------------------------
아래는 오류에 대한 해결방법을 복사해서 넣은건데요.
아래 내용을 이해할수가 없습니다.
프로그래머가 아니어서 간단한 설명이 제겐 어렵네요.ㅠㅠ
헤더를 올바른 위치가 어떤 문구를 어디 위치에 둬야 하는지와, ob_start()함수는 어디에다가 넣는지요?
--------------------------------------------------------------------------------------------------------
2. Warning: Cannot add header information - headers already sent by (output started at 경로:줄 수) in 경로 on line 줄 수
->헤더 정보를 추가할 수 없다 - 헤더가 벌써 보내졌다(?) (X줄 부터 출력되었다)
헤더 실행 위치의 오류입니다. 헤더는 출력 구문 앞에 와야만 하는데, 그렇지 못한 경우에 오류가 생깁니다. 앞의 줄 수는 맨 위에 있는 출력 구문(echo문, print문 등)의 위치이고 뒤의 줄 수는 헤더문의 위치입니다.
->1. 헤더를 올바른 위치에 둔다.
2. 오류가 일어나는 파일의 맨 위에 ob_start()함수를 위치시킨다(이 함수를 호출하면 저런 에러를 무시합니다).
->헤더 정보를 추가할 수 없다 - 헤더가 벌써 보내졌다(?) (X줄 부터 출력되었다)
헤더 실행 위치의 오류입니다. 헤더는 출력 구문 앞에 와야만 하는데, 그렇지 못한 경우에 오류가 생깁니다. 앞의 줄 수는 맨 위에 있는 출력 구문(echo문, print문 등)의 위치이고 뒤의 줄 수는 헤더문의 위치입니다.
->1. 헤더를 올바른 위치에 둔다.
2. 오류가 일어나는 파일의 맨 위에 ob_start()함수를 위치시킨다(이 함수를 호출하면 저런 에러를 무시합니다).
댓글 전체
이렇게 한 번 해 보세요.
1. head.php 화일의 상단 부분을 아래 소스로 바꾸시고
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
include_once("$g4[path]/head.sub.php");
include_once("$g4[path]/lib/outlogin.lib.php");
include_once("$g4[path]/lib/poll.lib.php");
include_once("$g4[path]/lib/visit.lib.php");
include_once("$g4[path]/lib/connect.lib.php");
include_once("$g4[path]/lib/popular.lib.php");
2. head.sub.php 소스도 아래 소스로 바꿔서 해 보세요.
첫 라인 부터 입니다. 같은 부분이 있을 겁니다.
<?
// 이 파일은 새로운 파일 생성시 반드시 포함되어야 함
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$begin_time = get_microtime();
if (!$g4['title'])
$g4['title'] = $config['cf_title'];
// 쪽지를 받았나?
if ($member['mb_memo_call']) {
$mb = get_member($member[mb_memo_call], "mb_nick");
sql_query(" update {$g4[member_table]} set mb_memo_call = '' where mb_id = '$member[mb_id]' ");
alert($mb[mb_nick]."님으로부터 쪽지가 전달되었습니다.", $_SERVER[REQUEST_URI]);
}
// 현재 접속자
//$lo_location = get_text($g4[title]);
//$lo_location = $g4[title];
// 게시판 제목에 ' 포함되면 오류 발생
$lo_location = addslashes($g4['title']);
if (!$lo_location)
$lo_location = $_SERVER['REQUEST_URI'];
//$lo_url = $g4[url] . $_SERVER['REQUEST_URI'];
$lo_url = $_SERVER['REQUEST_URI'];
if (strstr($lo_url, "/$g4[admin]/") || $is_admin == "super") $lo_url = "";
// 자바스크립트에서 go(-1) 함수를 쓰면 폼값이 사라질때 해당 폼의 상단에 사용하면
// 캐쉬의 내용을 가져옴. 완전한지는 검증되지 않음
header("Content-Type: text/html; charset=$g4[charset]");
$gmnow = gmdate("D, d M Y H:i:s") . " GMT";
header("Expires: 0"); // rfc2616 - Section 14.21
header("Last-Modified: " . $gmnow);
header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
header("Cache-Control: pre-check=0, post-check=0, max-age=0"); // HTTP/1.1
header("Pragma: no-cache"); // HTTP/1.0
?>
잘 되셨으면 좋겠네요.
1. head.php 화일의 상단 부분을 아래 소스로 바꾸시고
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
include_once("$g4[path]/head.sub.php");
include_once("$g4[path]/lib/outlogin.lib.php");
include_once("$g4[path]/lib/poll.lib.php");
include_once("$g4[path]/lib/visit.lib.php");
include_once("$g4[path]/lib/connect.lib.php");
include_once("$g4[path]/lib/popular.lib.php");
2. head.sub.php 소스도 아래 소스로 바꿔서 해 보세요.
첫 라인 부터 입니다. 같은 부분이 있을 겁니다.
<?
// 이 파일은 새로운 파일 생성시 반드시 포함되어야 함
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$begin_time = get_microtime();
if (!$g4['title'])
$g4['title'] = $config['cf_title'];
// 쪽지를 받았나?
if ($member['mb_memo_call']) {
$mb = get_member($member[mb_memo_call], "mb_nick");
sql_query(" update {$g4[member_table]} set mb_memo_call = '' where mb_id = '$member[mb_id]' ");
alert($mb[mb_nick]."님으로부터 쪽지가 전달되었습니다.", $_SERVER[REQUEST_URI]);
}
// 현재 접속자
//$lo_location = get_text($g4[title]);
//$lo_location = $g4[title];
// 게시판 제목에 ' 포함되면 오류 발생
$lo_location = addslashes($g4['title']);
if (!$lo_location)
$lo_location = $_SERVER['REQUEST_URI'];
//$lo_url = $g4[url] . $_SERVER['REQUEST_URI'];
$lo_url = $_SERVER['REQUEST_URI'];
if (strstr($lo_url, "/$g4[admin]/") || $is_admin == "super") $lo_url = "";
// 자바스크립트에서 go(-1) 함수를 쓰면 폼값이 사라질때 해당 폼의 상단에 사용하면
// 캐쉬의 내용을 가져옴. 완전한지는 검증되지 않음
header("Content-Type: text/html; charset=$g4[charset]");
$gmnow = gmdate("D, d M Y H:i:s") . " GMT";
header("Expires: 0"); // rfc2616 - Section 14.21
header("Last-Modified: " . $gmnow);
header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
header("Cache-Control: pre-check=0, post-check=0, max-age=0"); // HTTP/1.1
header("Pragma: no-cache"); // HTTP/1.0
?>
잘 되셨으면 좋겠네요.
ㅠㅠ 안되는데요..ㅠㅠ