iframe에서는 최신글 보기가 불러지는데, php include은 제대로 안되네요 정보
iframe에서는 최신글 보기가 불러지는데, php include은 제대로 안되네요본문
홈페이지 구조는
homepage 가 root 이고
new 밑에 main이란 폴더안에 메인페이지 php(mainhome.php)가 있고
new 밑에 gnuboard4 폴더가 있습니다.
notice_new.php는 notice라는 게시판의 최신글을 불러오기위한 php로
------------------------------------------------------------------------------------------
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<?
include_once("./_common.php");
include_once("$g4[path]/lib/latest.lib.php");
echo latest("basic", "notice", 5, 70);
?>
-------------------------------------------------------------------------------------
이와같이 작성 되어 있고요
<iframe src="/new/gnuboard4/notice_new.php"; ? width="300" frameborder="0" height="230" ></iframe><p>
로 작성해서 넣으면 mainhme.php 에서 notice.php의 최신글이 제대로 나옵니다.
문제는 iframe이기 때문에 클릭을 하면 해당 페이지로 이동되지 않고 iframe에서 게시글이 떠버리죠... 그래서 이걸 페이지 이동되게 php include를 사용 해봤는데
<?php include ("../gnuboard4/notice_new.php");?>
아래와 같은 경고 메시지만 뜨고 안됩니다. 경로문제 같은데 어떻게 수정해야할지 모르겠어요 ㅠ 부탁드립니다.
-----------------------------------------------------------------------------------------------
Warning: include_once(./_common.php) [function.include-once]: failed to open stream: No such file or directory in F:\homepage\new\gnuboard4\notice_new.php on line 3
Warning: include_once() [function.include]: Failed opening './_common.php' for inclusion (include_path='.') in F:\homepage\new\gnuboard4\notice_new.php on line 3
Warning: include_once(/lib/latest.lib.php) [function.include-once]: failed to open stream: No such file or directory in F:\homepage\new\gnuboard4\notice_new.php on line 4
Warning: include_once() [function.include]: Failed opening '/lib/latest.lib.php' for inclusion (include_path='.') in F:\homepage\new\gnuboard4\notice_new.php on line 4
Fatal error: Call to undefined function latest() in F:\homepage\new\gnuboard4\notice_new.php on line 6
---------------------------------------------------------------------------------------
homepage 가 root 이고
new 밑에 main이란 폴더안에 메인페이지 php(mainhome.php)가 있고
new 밑에 gnuboard4 폴더가 있습니다.
notice_new.php는 notice라는 게시판의 최신글을 불러오기위한 php로
------------------------------------------------------------------------------------------
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<?
include_once("./_common.php");
include_once("$g4[path]/lib/latest.lib.php");
echo latest("basic", "notice", 5, 70);
?>
-------------------------------------------------------------------------------------
이와같이 작성 되어 있고요
<iframe src="/new/gnuboard4/notice_new.php"; ? width="300" frameborder="0" height="230" ></iframe><p>
로 작성해서 넣으면 mainhme.php 에서 notice.php의 최신글이 제대로 나옵니다.
문제는 iframe이기 때문에 클릭을 하면 해당 페이지로 이동되지 않고 iframe에서 게시글이 떠버리죠... 그래서 이걸 페이지 이동되게 php include를 사용 해봤는데
<?php include ("../gnuboard4/notice_new.php");?>
아래와 같은 경고 메시지만 뜨고 안됩니다. 경로문제 같은데 어떻게 수정해야할지 모르겠어요 ㅠ 부탁드립니다.
-----------------------------------------------------------------------------------------------
Warning: include_once(./_common.php) [function.include-once]: failed to open stream: No such file or directory in F:\homepage\new\gnuboard4\notice_new.php on line 3
Warning: include_once() [function.include]: Failed opening './_common.php' for inclusion (include_path='.') in F:\homepage\new\gnuboard4\notice_new.php on line 3
Warning: include_once(/lib/latest.lib.php) [function.include-once]: failed to open stream: No such file or directory in F:\homepage\new\gnuboard4\notice_new.php on line 4
Warning: include_once() [function.include]: Failed opening '/lib/latest.lib.php' for inclusion (include_path='.') in F:\homepage\new\gnuboard4\notice_new.php on line 4
Fatal error: Call to undefined function latest() in F:\homepage\new\gnuboard4\notice_new.php on line 6
---------------------------------------------------------------------------------------
댓글 전체
<?
$g4_path = "../gnuboard4"; // common.php 의 상대 경로 ★★ - 상황별 ../ 수정
include_once("$g4_path/common.php"); // ★★
include_once("$g4[path]/head.sub.php");
include_once("$g4[path]/lib/latest.lib.php");
echo latest("basic", "notice", 5, 70);
?>
로 테스트 해 보세요.
$g4_path = "../gnuboard4"; // common.php 의 상대 경로 ★★ - 상황별 ../ 수정
include_once("$g4_path/common.php"); // ★★
include_once("$g4[path]/head.sub.php");
include_once("$g4[path]/lib/latest.lib.php");
echo latest("basic", "notice", 5, 70);
?>
로 테스트 해 보세요.
head.sub.php 부분이 에러가 나서 지우니 출력은 되는데 이번엔 인코딩 문제가 생기네요
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
과 같은 부분을 추가해도 한글이 깨지는 현상이 발생하는데, 왜그럴까요
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
과 같은 부분을 추가해도 한글이 깨지는 현상이 발생하는데, 왜그럴까요
main 폴더
- mainhome.php
gnuboard4 폴더
- 모든그누 폴더파일
- notice_new.php
mainhome.php 파일 내용
<?php include ("../gnuboard4/notice_new.php");?>
notice_new.php 파일 내용
<?
$g4_path = "../gnuboard4"; // common.php 의 상대 경로 ★★ - 상황별 ../ 수정
include_once("$g4_path/common.php"); // ★★
include_once("$g4[path]/head.php");
include_once("$g4[path]/head.sub.php");
include_once("$g4[path]/lib/latest.lib.php");
echo latest("basic", "notice", 5, 70);
?>
위와 같은 구성으로 기본 테스트 해 보세요. 오류 없는 내용임
똑같이 적용후 오류 메시지 발생시 각 파일의 정확한 위치를 포함 추가 질문 필요
- mainhome.php
gnuboard4 폴더
- 모든그누 폴더파일
- notice_new.php
mainhome.php 파일 내용
<?php include ("../gnuboard4/notice_new.php");?>
notice_new.php 파일 내용
<?
$g4_path = "../gnuboard4"; // common.php 의 상대 경로 ★★ - 상황별 ../ 수정
include_once("$g4_path/common.php"); // ★★
include_once("$g4[path]/head.php");
include_once("$g4[path]/head.sub.php");
include_once("$g4[path]/lib/latest.lib.php");
echo latest("basic", "notice", 5, 70);
?>
위와 같은 구성으로 기본 테스트 해 보세요. 오류 없는 내용임
똑같이 적용후 오류 메시지 발생시 각 파일의 정확한 위치를 포함 추가 질문 필요