묻고답하기

main.php 랑 yes.php, no.php 이 세파일을 읽어와서 스킨처럼 뿌리는 게시판을 만들려고 해요

본체는

--------
yn.php
--------
<?
/*
Yes or No

메인 스레드-

리플 테이블 에서 메인 테이블 스레드 넘버 참조식

리플 테이블 좋다/나쁘다 2개로

넘버-제목-날짜-설명-IP

CREATE TABLE mainlist (
no int(8) DEFAULT '0' NOT NULL auto_increment,
subject varchar(255) NOT NULL,
date varchar(8) NOT NULL,
comment varchar(255) DEFAULT '10' NOT NULL,
iplog varchar(15) NOT NULL,
PRIMARY KEY (no)
);
CREATE TABLE yeslist (
no int(8) DEFAULT '0' NOT NULL auto_increment,
comment text NOT NULL,
mother int(8) NOT NULL,
iplog varchar(15) NOT NULL,
PRIMARY KEY (no)
);
CREATE TABLE nolist (
no int(8) DEFAULT '0' NOT NULL auto_increment,
comment text NOT NULL,
mother int(8) NOT NULL,
iplog varchar(15) NOT NULL,
PRIMARY KEY (no)
);

*/

//DB설정 부분
$host = "localhost";
$user = "aaa";
$password = "bbb";
$db = "aaa";
$connect = mysql_connect ($host,$user,$password) or die(print "<center>DB에 연결할수 없습니다.</center>");


//스킨파일 이름
$skin_main='main.php';
$skin_yes='yes.php';
$skin_no='no.php';

//페이지 당 출력갯수
$view_limit = 20;
//[1] [2] ..몇개나 한번에 나올지
$show_page_num = 10;
mysql_select_db ($db,$connect);

//에러메세지 처리루틴
function message ($message)
{
   echo "
        <script>
        window.alert ("$message");
        history.go(-1);
        </script>
        ";
exit;
}

// 메인 리스트 출력 시작 - 스킨처리도 겸비
$query = mysql_query("select * from mainlist",$connect);
while($data=mysql_fetch_array($query))
{
        $fmainp = fopen($skin_main,"r");
        $fmain = fread($fmainp,filesize($skin_main));
        $fmain = str_replace("<!--subject-->",$data[subject],$fmain);
        $fmain = str_replace("<!--date-->",$data[date],$fmain);
        $data[comment]=nl2br($data[comment]);
        $fmain = str_replace("<!--comment-->",$data[comment],$fmain);
        echo "$fmain";
        fclose($fmainp);

        //Yes 리플 출력 시작
        $query_yes = mysql_query("select * from yeslist where mother='$data[no]';",$connect);
        while($yesdata=mysql_fetch_array($query_yes))
        {
                $fyesp = fopen($skin_yes,"r");
                $yesdata[comment]=nl2br($yesdata[comment]);
                $fyes = str_replace("<!--yes_comment-->",$yesdata[comment],$fyes);
                echo "$fyes";
                fclose($fyesp);
        }

        //No 리플 출력 시작
        $query_no = mysql_query("select * from nolist where mother='$data[no]';",$connect);
        while($nodata=mysql_fetch_array($query_no))
        {
                $fnop = fopen($skin_no,"r");
                $nodata[comment]=nl2br($nodata[comment]);
                $fno = str_replace("<!--no_comment-->",$nodata[comment],$fno);
                echo "$fno";
                fclose($fnop);
        }
}


?>

이렇구요 main.php 의 내용은

----------
main.php
----------
이게 메인<br>
<!--subject--><br>
<!--date--><br>
<!--comment--><br>
<!--yes_comment--><br>
<!--no_comment--><br>


이어서 yes.php 와 no.php 는 각각

---------
yes.php
---------
예스코멘트<br>
<!--yes_comment--><br>

--------
no.php
--------
노우코멘트<br>
<!--no_comment--><br>


이렇거든요

yn.php 파일을 부르면 저 세 파일들이 다 한화면에 뜨도록 할 생각인데
아무리해도 main.php 파일의 내용만 출력되요;;

수정 조언을 좀 부탁드립니다;;
글쓴이 제목 최종 글
XE 공지 글 쓰기,삭제 운영방식 변경 공지 [16] 2019.03.05 by 남기남
이소현 이런기술 어떻게 구현한지 아시는분????? [2] 2007.08.10
한진욱 나모로 서브메뉴를 사용할려구합니다. [2] 2007.08.10
슈메이커 select form 으로 새창띄울때요! [1] 2007.08.10
나그네 사용자가 즐겨찾기를 메인페이지로 등록하게 하려면 어떻게 해야 하나요?  
재로 배경음악을 달았는데, 저는 재생되고 친구들은 재생이 안된데요! [2] 2007.08.10
cubevideo 비번없으면 못읽는 게시판 궁금해요~~ [3] 2007.08.10
미자 한개의 form 에 두개의 action 지정.. [2] 2007.08.10
llll 테이블 태그에 대한 질문입니다. [2] 2007.08.10
후지야 테이블 질문입니다 [1] 2007.08.10
유나 노프레임 메뉴요!!!!!!!! [1] 2007.08.10
미색아: 나모에서요! [1] 2007.08.10
김현섭 테이블에 이미지를 넣으면 테이블이 늘어나는 이유는? [4] 2007.08.10
레드 이 흰색을 지우는 방법 알려주세요.. [2] 2007.08.10
김경태 페이지 열자마자 전체화면뜨게하는 스크립트를 알고싶어요 [1] 2007.08.10
DigiT@L_CoRE [포토샵질문] 메뉴에 이미지 모드에 보면 8비트와 16비트가 있던데요...  
이영한 ELLE 에 쓰인 글씨체..? [2] 2007.08.10
손종욱 으아!!!! 큰일났어요!!! 제발좀 답변부탁드려요!!!! [1] 2007.08.10
김성준 새창관련 [1] 2007.08.10
김민호 노프레임과 프레임의 차이가뭔가요?? 그리고 기타포토샵질문들..... [4] 2007.08.10
whitecrow 윈2k랑 윈2000이랑 -_-;;; [기초적인질문] [2] 2007.08.10
Rapire win2000서버 iis돌리고 있는데 모니터 프로그램은 어떤걸 사용할수 있나여? [1] 2007.08.10
백승열 질문이에요~!! [1] 2007.08.10
김성준 폰트에 관해서 [3] 2007.08.10
鍾烈 쿼리 100번? [2] 2007.08.10
김유정 윈도우 nt 4.0 에서 제로보드 설치하는 법 좀 알려 주세요... [1] 2007.08.10
면발의진수 스킨기능을 만들어 볼려는데...  
김경태 드림위버4는 타 웹에디터 (프론트페이지,나모웹에디터) 처럼 html을 볼수가 없나요? [2] 2007.08.10
자바메뉴과련 질문입니다.... [1] 2007.08.10
김유진 로그인폼과 게시판. [1] 2007.08.10
냐하하 윈도우 2000에서 트래픽 다시질문....