html 에서 file.php include 와 php파일에서 html include 시 문제. 정보
html 에서 file.php include 와 php파일에서 html include 시 문제.첨부파일
본문
문제가 이렇습니다.
기본적으로 이미 만들어져 있는 홈페이지가 있습니다.
GNU 보드를 기존의 홈페이지에다 게시판으로 쓸 목적으로 MySQL 을 UTF8 버전으로 요청 설치하여
마쳤습니다. 보드는 나름대로 혼자서 잘 돌아가는 것을 확인하였습니다.
문제는 2가지 입니다.
기존에 있는 html 파일에 그누보드의 게시판을 붙이기 위해서
그누보드의 index.php 파일에 다음과 같이 html 파일을 include 를 시켰습니다.
<?
include_once("./_includecommon.php");
include_once("$g4[path]/lib/latest.lib.php");
$g4['title'] = "+ ATENAS +";
include_once("./_includehead.php");
?>
<?
include_once("sup_notice_include.html");
?>
--------------------------------------------------------------
위와같이 하자 문제가 기존의 html 파일과 php 파일이 뿌려지는 위치가 달라져 (상위와 하위)
다시 다음과 같이 html 파일을 가장 처음에 놓았습니다.
---------------------------------------------------------------
<?
include_once("sup_notice_include.html");
include_once("sup_notice_include.html");
include_once("./_includecommon.php");
include_once("$g4[path]/lib/latest.lib.php");
$g4['title'] = "+ ATENAS +";
include_once("./_includehead.php");
?>
-----------------------------------------------------------------
그러자 이번엔 위치는 html 파일이 먼저 나와서 좋기는 한데 다음과 같은 에러가 발생합니다.
게다가 게시판의 글자도 모두 깨져서 보이구요.
어디서부터 손을 대야 할 지 모르겠습니다.
아마도 html 파일은 utf8 이 아니라 euckr 로 작성이 된 듯 합니다.
어떤 방식으로 이 문제를 빠르고 쉽게 해결할 수 있을지요?
원하는 것은 기존의 html 페이지에다가 GNU 보드의 게시판을 올려놓고자 하는 것이 목적입니다.
---------------------------------------------------------------------------------------------------------------------------------
Warning: Cannot modify header information - headers already sent by (output started at /home2/atenasftp/wwwhome/admin/sup_notice_include.html:7) in /home2/atenasftp/wwwhome/admin/includecommon.php on line 8
Warning: Cannot modify header information - headers already sent by (output started at /home2/atenasftp/wwwhome/admin/sup_notice_include.html:7) in /home2/atenasftp/wwwhome/admin/includehead.sub.php on line 32
Warning: Cannot modify header information - headers already sent by (output started at /home2/atenasftp/wwwhome/admin/sup_notice_include.html:7) in /home2/atenasftp/wwwhome/admin/includehead.sub.php on line 34
Warning: Cannot modify header information - headers already sent by (output started at /home2/atenasftp/wwwhome/admin/sup_notice_include.html:7) in /home2/atenasftp/wwwhome/admin/includehead.sub.php on line 35
Warning: Cannot modify header information - headers already sent by (output started at /home2/atenasftp/wwwhome/admin/sup_notice_include.html:7) in /home2/atenasftp/wwwhome/admin/includehead.sub.php on line 36
Warning: Cannot modify header information - headers already sent by (output started at /home2/atenasftp/wwwhome/admin/sup_notice_include.html:7) in /home2/atenasftp/wwwhome/admin/includehead.sub.php on line 37
Warning: Cannot modify header information - headers already sent by (output started at /home2/atenasftp/wwwhome/admin/sup_notice_include.html:7) in /home2/atenasftp/wwwhome/admin/includehead.sub.php on line 38
기본적으로 이미 만들어져 있는 홈페이지가 있습니다.
GNU 보드를 기존의 홈페이지에다 게시판으로 쓸 목적으로 MySQL 을 UTF8 버전으로 요청 설치하여
마쳤습니다. 보드는 나름대로 혼자서 잘 돌아가는 것을 확인하였습니다.
문제는 2가지 입니다.
기존에 있는 html 파일에 그누보드의 게시판을 붙이기 위해서
그누보드의 index.php 파일에 다음과 같이 html 파일을 include 를 시켰습니다.
<?
include_once("./_includecommon.php");
include_once("$g4[path]/lib/latest.lib.php");
$g4['title'] = "+ ATENAS +";
include_once("./_includehead.php");
?>
<?
include_once("sup_notice_include.html");
?>
--------------------------------------------------------------
위와같이 하자 문제가 기존의 html 파일과 php 파일이 뿌려지는 위치가 달라져 (상위와 하위)
다시 다음과 같이 html 파일을 가장 처음에 놓았습니다.
---------------------------------------------------------------
<?
include_once("sup_notice_include.html");
include_once("sup_notice_include.html");
include_once("./_includecommon.php");
include_once("$g4[path]/lib/latest.lib.php");
$g4['title'] = "+ ATENAS +";
include_once("./_includehead.php");
?>
-----------------------------------------------------------------
그러자 이번엔 위치는 html 파일이 먼저 나와서 좋기는 한데 다음과 같은 에러가 발생합니다.
게다가 게시판의 글자도 모두 깨져서 보이구요.
어디서부터 손을 대야 할 지 모르겠습니다.
아마도 html 파일은 utf8 이 아니라 euckr 로 작성이 된 듯 합니다.
어떤 방식으로 이 문제를 빠르고 쉽게 해결할 수 있을지요?
원하는 것은 기존의 html 페이지에다가 GNU 보드의 게시판을 올려놓고자 하는 것이 목적입니다.
---------------------------------------------------------------------------------------------------------------------------------
Warning: Cannot modify header information - headers already sent by (output started at /home2/atenasftp/wwwhome/admin/sup_notice_include.html:7) in /home2/atenasftp/wwwhome/admin/includecommon.php on line 8
Warning: Cannot modify header information - headers already sent by (output started at /home2/atenasftp/wwwhome/admin/sup_notice_include.html:7) in /home2/atenasftp/wwwhome/admin/includehead.sub.php on line 32
Warning: Cannot modify header information - headers already sent by (output started at /home2/atenasftp/wwwhome/admin/sup_notice_include.html:7) in /home2/atenasftp/wwwhome/admin/includehead.sub.php on line 34
Warning: Cannot modify header information - headers already sent by (output started at /home2/atenasftp/wwwhome/admin/sup_notice_include.html:7) in /home2/atenasftp/wwwhome/admin/includehead.sub.php on line 35
Warning: Cannot modify header information - headers already sent by (output started at /home2/atenasftp/wwwhome/admin/sup_notice_include.html:7) in /home2/atenasftp/wwwhome/admin/includehead.sub.php on line 36
Warning: Cannot modify header information - headers already sent by (output started at /home2/atenasftp/wwwhome/admin/sup_notice_include.html:7) in /home2/atenasftp/wwwhome/admin/includehead.sub.php on line 37
Warning: Cannot modify header information - headers already sent by (output started at /home2/atenasftp/wwwhome/admin/sup_notice_include.html:7) in /home2/atenasftp/wwwhome/admin/includehead.sub.php on line 38
댓글 전체
sup_notice_include.html 화일을 사용하시는 에디터(예:acroedit등)로 열어주세요.
화일 상단에 보시면 아래의 부분이 있습니다.
<head>
<title>+ ATENAS + </title>
<meta http-equiv="Content-Type" content="text/html" charset="euc-kr" />
<link href="common/at.css" rel="stylesheet" type="text/css" />
<script type="text/JavaScript" language="JavaScript" src="common/flash.js"></script>
</head>
여기서 charset이 euc-kr로 되어 있네요. 이것을 utf-8로 수정해 주시구요.
저장하실 때 unicode utf-8로 저장하시고 업로드 하신 후 사용하시면 될 것 같습니다.
화일 상단에 보시면 아래의 부분이 있습니다.
<head>
<title>+ ATENAS + </title>
<meta http-equiv="Content-Type" content="text/html" charset="euc-kr" />
<link href="common/at.css" rel="stylesheet" type="text/css" />
<script type="text/JavaScript" language="JavaScript" src="common/flash.js"></script>
</head>
여기서 charset이 euc-kr로 되어 있네요. 이것을 utf-8로 수정해 주시구요.
저장하실 때 unicode utf-8로 저장하시고 업로드 하신 후 사용하시면 될 것 같습니다.
참 그리고 아래 글을 참고하시면 많은 도움이 되실 겁니다.
감사합니다. 글자가 깨지는 것은 해결이 되었습니다. 그런데 아무래도 header file 부분에서 html 파일에서 사용하는 header 와 php 상의 includehead.su.php 에서 사용하는 헤더와 충돌현상이 있는것 같습니다.
다음과 같은 에러는 지워지지 않고 계속 나옵니다. 혹시 강제적으로 에러메세지를 발생시키지 않을 방법같은 건 있나요? 아니면 에러를 근본적으로 없애려면 어떻게 해야 합니까?
-----------------------------------------------------------------------------------------------------------
Warning: Cannot modify header information - headers already sent by (output started at /home2/atenasftp/wwwhome/admin/sup_notice_include.html:7) in /home2/atenasftp/wwwhome/admin/includehead.sub.php
다음과 같은 에러는 지워지지 않고 계속 나옵니다. 혹시 강제적으로 에러메세지를 발생시키지 않을 방법같은 건 있나요? 아니면 에러를 근본적으로 없애려면 어떻게 해야 합니까?
-----------------------------------------------------------------------------------------------------------
Warning: Cannot modify header information - headers already sent by (output started at /home2/atenasftp/wwwhome/admin/sup_notice_include.html:7) in /home2/atenasftp/wwwhome/admin/includehead.sub.php
아래글을 참고 하시라고 하고 참고 글을 빼먹었네요^^
http://www.sir.co.kr/bbs/tb.php/pl_php/33/e562a558828f1aa55377164150e819f7
http://www.sir.co.kr/bbs/tb.php/pl_php/33/e562a558828f1aa55377164150e819f7
감사합니다. 그런데 아무리 해도 안되서 다시 올립니다.
ob_start(); 를 다음과 같이 입력 하였습니다.
include 는 다음과 같이 하였구요.
<html>
<table>
....
....
<tr>
<? include "./include.php"; ?></tr>
</table>
....
</html>
-------------------------------------------------------------------
다음은 위 html 파일에 include 한 include.php 입니다.
<?
ob_start();
include_once("./_includecommon.php");
include_once("$g4[path]/lib/latest.lib.php");
$g4['title'] = "";
include_once("./_includehead.php");
?>
------------------------------------------------------------------
오류내용
Warning: Cannot modify header information - headers already sent by (output started at /home2/atenasftp/wwwhome/gnu/sup_notice_include.html:6) in /home2/atenasftp/wwwhome/gnu/includecommon.php on line 8
Warning: Cannot modify header information - headers already sent by (output started at /home2/atenasftp/wwwhome/gnu/sup_notice_include.html:6) in /home2/atenasftp/wwwhome/gnu/head.sub.php on line 32
Warning: Cannot modify header information - headers already sent by (output started at /home2/atenasftp/wwwhome/gnu/sup_notice_include.html:6) in /home2/atenasftp/wwwhome/gnu/head.sub.php on line 34
Warning: Cannot modify header information - headers already sent by (output started at /home2/atenasftp/wwwhome/gnu/sup_notice_include.html:6) in /home2/atenasftp/wwwhome/gnu/head.sub.php on line 35
Warning: Cannot modify header information - headers already sent by (output started at /home2/atenasftp/wwwhome/gnu/sup_notice_include.html:6) in /home2/atenasftp/wwwhome/gnu/head.sub.php on line 36
Warning: Cannot modify header information - headers already sent by (output started at /home2/atenasftp/wwwhome/gnu/sup_notice_include.html:6) in /home2/atenasftp/wwwhome/gnu/head.sub.php on line 37
Warning: Cannot modify header information - headers already sent by (output started at /home2/atenasftp/wwwhome/gnu/sup_notice_include.html:6) in /home2/atenasftp/wwwhome/gnu/head.sub.php on line 38
ob_start(); 를 다음과 같이 입력 하였습니다.
include 는 다음과 같이 하였구요.
<html>
<table>
....
....
<tr>
<? include "./include.php"; ?></tr>
</table>
....
</html>
-------------------------------------------------------------------
다음은 위 html 파일에 include 한 include.php 입니다.
<?
ob_start();
include_once("./_includecommon.php");
include_once("$g4[path]/lib/latest.lib.php");
$g4['title'] = "";
include_once("./_includehead.php");
?>
------------------------------------------------------------------
오류내용
Warning: Cannot modify header information - headers already sent by (output started at /home2/atenasftp/wwwhome/gnu/sup_notice_include.html:6) in /home2/atenasftp/wwwhome/gnu/includecommon.php on line 8
Warning: Cannot modify header information - headers already sent by (output started at /home2/atenasftp/wwwhome/gnu/sup_notice_include.html:6) in /home2/atenasftp/wwwhome/gnu/head.sub.php on line 32
Warning: Cannot modify header information - headers already sent by (output started at /home2/atenasftp/wwwhome/gnu/sup_notice_include.html:6) in /home2/atenasftp/wwwhome/gnu/head.sub.php on line 34
Warning: Cannot modify header information - headers already sent by (output started at /home2/atenasftp/wwwhome/gnu/sup_notice_include.html:6) in /home2/atenasftp/wwwhome/gnu/head.sub.php on line 35
Warning: Cannot modify header information - headers already sent by (output started at /home2/atenasftp/wwwhome/gnu/sup_notice_include.html:6) in /home2/atenasftp/wwwhome/gnu/head.sub.php on line 36
Warning: Cannot modify header information - headers already sent by (output started at /home2/atenasftp/wwwhome/gnu/sup_notice_include.html:6) in /home2/atenasftp/wwwhome/gnu/head.sub.php on line 37
Warning: Cannot modify header information - headers already sent by (output started at /home2/atenasftp/wwwhome/gnu/sup_notice_include.html:6) in /home2/atenasftp/wwwhome/gnu/head.sub.php on line 38
아! html 파일 제일 위에다 하니까 되는군요~!
친절한 답변 감사합니다.
^^*
친절한 답변 감사합니다.
^^*
추가 질문 하나만 더 드리겠습니다.
답변 덕분에 다행이 원하는 화면을 출력 할 수 있었습니다.
그런데 문제가 게시판을 클릭했을때 게시판 글 하나가 전체 화면이 되어 나타나는군요.
다음과 같은 링크와 함께요....
http://.co.kr/gnu/bbs/board.php?bo_table=Board&wr_id=1
사실 게시판을 이미 아이프레임안에다 넣는 것은 해 놓은 상태입니다.
단지 처음 화면 부분에 좀 더 깔끔한 화면이 가능할까 하고 include.php 를 이용해서 게시판
초기화면을 보여주고자 했던 것인데....
이 다음이 문제입니다....
include 된 파일을 아이프레임 안에다 넣을 수 있을까요?
아니면 "http://.co.kr/gnu/bbs/board.php?bo_table=Board&wr_id=1" 이 링크의 소스를 이용해서
노프레임으로 다시 페이지를 구성하여야 할까요?
어떻게 해야 좋을지 난감합니다.
누군가 적절한 답변을 주실 수 있을런지요?
답변 덕분에 다행이 원하는 화면을 출력 할 수 있었습니다.
그런데 문제가 게시판을 클릭했을때 게시판 글 하나가 전체 화면이 되어 나타나는군요.
다음과 같은 링크와 함께요....
http://.co.kr/gnu/bbs/board.php?bo_table=Board&wr_id=1
사실 게시판을 이미 아이프레임안에다 넣는 것은 해 놓은 상태입니다.
단지 처음 화면 부분에 좀 더 깔끔한 화면이 가능할까 하고 include.php 를 이용해서 게시판
초기화면을 보여주고자 했던 것인데....
이 다음이 문제입니다....
include 된 파일을 아이프레임 안에다 넣을 수 있을까요?
아니면 "http://.co.kr/gnu/bbs/board.php?bo_table=Board&wr_id=1" 이 링크의 소스를 이용해서
노프레임으로 다시 페이지를 구성하여야 할까요?
어떻게 해야 좋을지 난감합니다.
누군가 적절한 답변을 주실 수 있을런지요?