묻고답하기

체크된 곳만 그 정보를 가져와서 그 다음페이지에서 연속적으로 그 데이타를 처리하려고 하는데 그 다음 페이지에 그 정보가 나오지 않습니다. 이 문제 점 해결해주세여 이틀동안 돌머리로 머리만 뿌수고 있습니다. 도움좀 주세여


=========================list.page==================================


<SCRIPT LANGUAGE='JavaScript'>
        <!--
                function printsubmit(print) {
                        document.print.submit();
                }
        //-->
                </SCRIPT>

<?
include "lib.php";
$mc=mysql_connect("localhost","","");
$ms=mysql_select_db("",$mc);

$num_per_page = 10;
$page_per_block = 10;

if(!$page) {
        $page = 1;
}
if($mode == "search") {
        $result = mysql_query("select no, subject, date, name, mass, age, mail, tel, phone, comment from member_table where  $keyfield like'$keyword%' order by date desc");
} else if($mode == "member") {
        $result = mysql_query("select no, subject, date, name, mass, age, mail, tel, phone, comment from member_table where userlevel='2'order by date desc");
} else {
$result = mysql_query("select no, subject, date, name,  mass, age, mail, tel, phone, comment from member_table order by date desc");
}
$total_record = mysql_num_rows($result);
$date = date("Y/m/d",$row->date);
if(!$total_record) {
        $first = 1;
        $last = 0;
} else {
        $first = $num_per_page*($page-1);
        $last = $num_per_page*$page;

        $IsNext = $total_record - $last;
        if($IsNext > 0) {
                $last -= 1;
        } else {
                $last = $total_record - 1;
        }
}

$total_page = ceil($total_record/$num_per_page);

?>


<HTML>
<HEAD>
<TITLE>회원 리스트</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=euc-kr">
<style type="text/css">
a:link { text-decoration: none; color: #000000 }
a:active { text-decoration: none; color: #000000 }
a:visited { text-decoration: none; color: #000000 }
a:hover { text-decoration : underline; color: red}
body { font-family: "굴림";        font-size: 9pt;        color: #000000;}
input {  font-family: "굴림"; font-size: 9pt; color: #000000}
table {  font-family: "굴림"; font-size: 9pt; color: #000000}
.input { border: solid 1px #000000; background-color:white;}
</style>
</HEAD>

<BODY>
<table width="860" border="1" align=center cellpadding=0 cellspacing=0 >
  <tr>
                
    <td valign="top">
      <table width="860" align=center cellpadding=0 cellspacing=0>
        <tr>
                                        <td>
                                                <table cellpadding=0 cellspacing=0 align=center width=100%>
                                                        <tr>
                                                                <?
                                                                if($mode == "member") {
                                                                        echo "<td align=center><font color=white><b>멤버 리스트</b></font></td>";
                                                                } else {        
                                                                        echo "<td align=center><font color=white><b>회원 리스트</b></font></td>";
                                                                }
                                                                ?>
                                                        </tr>
                                                </table>
                                        </td>
                                </tr>
                                <tr>
                                        
          <td>
            <table cellpadding=0 cellspacing=0 align=center width="860">
                                                        <tr>
                                                                <td>Page: <b><?echo "${page}/${total_page}"?></b></td>
                                                                <td align=right>총질문원수 : <b><?echo "${total_record}명"?></b></td>
                                                        </tr>
                                                </table>
                                        </td>
                                </tr>
                                <tr>
                                        <td>
                                                <table cellpadding=0 cellspacing=0 align=center width="860">
              <tr>
                          <td align=center bgcolor="#CCCCCC" width="40"><strong>No</strong></td>
                <td align=center bgcolor="#CCCCCC" width="40"><strong>과목별</strong></td>
                <td align=center bgcolor="#CCCCCC" width="80"><strong>접수일</strong></td>
                                <td align=center bgcolor="#CCCCCC" width="60"><strong>비회원명</strong></td>
                <td align=center bgcolor="#CCCCCC" width="80"><strong>매체</strong></td>
                                <td align=center bgcolor="#CCCCCC" width="60"><strong>나이</strong></td>
                <td align=center bgcolor="#CCCCCC" width="140"><strong>메일</strong></td>
                <td align=center bgcolor="#CCCCCC" width="120"><strong>전화번호</strong></td>
                <td align=center bgcolor="#CCCCCC" width="120"><strong>핸드폰</strong></td>
                <td align=center bgcolor="#CCCCCC" width="80"><strong>질문 내용</strong></td>
                            <td align=center bgcolor="#CCCCCC" width="40"><strong></strong></td>
              </tr>
            
              </tr>
            </table>
                                        </td>
                                </tr>

<?

                                $num = $total_record - $num_per_page*($page-1);
                                
                                        for($i=$first; $i<=$last; $i++) {
                                        $no = mysql_result($result,$i,0);
                                        $subject = mysql_result($result,$i,1);
                                        $date = mysql_result($result,$i,2);
                                        $name = mysql_result($result,$i,3);
                                        $mass = mysql_result($result,$i,4);
                                        $age = mysql_result($result,$i,5);
                                        $mail = mysql_result($result,$i,6);
                                        $tel = mysql_result($result,$i,7);
                                        $phone = mysql_result($result,$i,8);
                                        $comment = mysql_result($result,$i,9);
                                    $cutcommment = kstrcut($comment, 10, "...");
                                        echo "
                                                <tr>
                                                        <td>
                                                                <table cellpadding=0 cellspacing=1 width=100%>
                                                                        <tr>
                                                                                <td align=center width=40>$no</td>
                                                                <td align=center width=40>$subject</td>
                                                                                <td align=center width=80>$date</td>
                                                                <td align=center width=60><a href='member_info.php?no=$no&page=$page'>$name</td>
                                                                <td align=center width=80>$mass</td>
                                                                <td align=center width=60>$age</td>
                                                                <td align=center width=140>$mail</td>
                                                                <td align=left width=120>$tel</td>
                                                                <td align=left width=120>$phone</td>
                                                                <td align=left width=80>$cutcommment</td>
                                                                                <td align=center width=40><INPUT TYPE=checkbox NAME=check[] value=$no></td>
                                                                        </tr>
                                                                </table>
                                                        </td>
                                                </tr>
                                        ";
                                        $num--;
                                }
?>

                        </table>
                
    </td>
        </tr>
        <tr>
                <td>
                        <table  align=center cellpadding=0 cellspacing=0>
       <?
                                                $total_block = ceil($total_page/$page_per_block);
                                                $block = ceil($page/$page_per_block);

                                                $first_page = ($block-1) * $page_per_block;
                                                $last_page = $block*$page_per_block;

                                                if($block >= $total_block) {
                                                        $last_page = $total_page;
                                                }

                                                if($block > 1) {
                                                        $is_page = $first_page;
                                                        echo "<a href='member_list.php?page=$is_page'>[이전 ${page_per_block}개]</a>";
                                                }

                                                for($link_page=$first_page+1; $link_page<=$last_page; $link_page++) {
                                                        if($page == $link_page) {
                                                                echo "<b>$link_page</b> ";
                                                        } else {
                                                                echo "<a href='member_list.php?page=$link_page'>$link_page</a> ";
                                                        }
                                                }

                                                if($block < $total_block) {
                                                        $is_page = $last_page+1;
                                                        echo "<a href='member_list.php?&page=$is_page'>[다음 $page_per_block개]</a>";
                                                }
                                                ?>
                                        </td>
                                </tr>
                        </table>
                </td>
        </tr>
</table>
<table cellpadding=0 cellspacing=0 align=center width=300>
                <tr>
                <td colspan=8 align=center>
                        <form name=search method=post action="<?echo $PHP_SELF?>?mode=search">
                        <select name="keyfield">
                                <option value="name" selected>이름</option>
                                <option value="mail">메일</option>
                                <option value="age">나이</option>
                                <option value="subject">과목</option>
                        </select>
                        <input type=text name=keyword size=20><input type=submit value="찾기">
                        </form>
                </td>
                
    <td> <form name="print" method="post" action="print.php?no=<?$check[$no]?>">
        <input name="print" type="submit" id="print" value="프린트">
      </form>
      
    </td>
        </tr>
</table>
</BODY>
</HTML>


===========================print.php=====================================


<?
$mc=mysql_connect("localhost","","");
$ms=mysql_select_db("",$mc);

for ($i=0; $i<sizeof($check);$i++){
getcontentsfromno($check[$i]);
}

##### 인자로 넘겨받은 게시물 레코드의 no 필드값으로 부터 해당 게시물을 출력하는 함수를 정의한다.
function getContentsFromno($value)


  
##### 데이터베이스 연결에 필요한 변수를 전역변수로 선언한다.
   GLOBAL $ms;
  

   ##### 선택한 게시물의 입력값을 뽑아낸다.
   $query = "select person, date, subject, mass, name, age, tel, phone, mail, comment from  member_table WHERE no = $check[$no]";
   $result = mysql_query($query);
  
   $row = mysql_fetch_row($result);

   $person = $row[1];
   $date = date("Y년 m월 d일,$row[2]");
   $subject= $row[3];
   $mass = $row[4];
   $name = $row[5];        
   $age = $row[6];
   $tel = $row[7];
   $phone = $row[8];
   $mail = $row[9];
   $comment = $row[10];
  

?>
<head>
</head>
<body>
<table width="776" height="229" border="1">
  <tr>
    <td width="776" valign="top">
<table width="100%" height="195" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td width="100"><div align="center">담당자</div></td>
          <td> <?echo("$person")?></td>
          <td width="100">접수일</td>
          <td> <?echo("$date")?></td>
        </tr>
        <tr>
          <td><div align="center">과  목</div></td>
          <td> <?echo("$subject")?></td>
          <td>매체</td>
          <td> <?echo("$mass")?></td>
        </tr>
        <tr>
          <td><div align="center">비회원명</div></td>
          <td> <?echo("$name")?>;</td>
          <td>나이</td>
          <td> <?echo("$age")?></td>
        </tr>
        <tr>
          <td><div align="center">Tel</div></td>
          <td> <?echo("$tel")?></td>
          <td>핸드폰</td>
          <td> <?echo("$phone")?></td>
        </tr>
        <tr>
          <td><div align="center">이메일</div></td>
          <td colspan="3"> <?echo "<a href=mailto:$mail>$mail</a>"?></td>
        </tr>
        <tr>
          <td><div align="center">질문사항</div></td>
          <td colspan="3"><?echo("$comment")?></td>
        </tr>
        <tr>
          <td><div align="center">통화내용</div></td>
          <td colspan="3"> </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
</body>
</html>
글쓴이 제목 최종 글
XE 공지 글 쓰기,삭제 운영방식 변경 공지 [16] 2019.03.05 by 남기남
오기수 [왕초보]마우스를 갖다대면 움직이는 메뉴바들.....부탁드릴게요^^ [1] 2007.08.10
최원신 팝업창을 최상위 화면에 두기... [1] 2007.08.10
오한호 라디오 버튼의 변수값을 다른 파일에서 사용하는 방법이 있습니까? [4] 2007.08.10
특급잠수부 [re] 라디오 버튼의 변수값을 다른 파일에서 사용하는 방법이 있습니까? [2] 2007.08.10
수라비 리눅스의 보안과 웜바이러스 질문이예요  
수라비 리눅스 아파치서버 설정에서요 cgi파일을 perl로 작동하게어케해요? [2] 2007.08.10
수라비 리눅스보안과 웜바이러스 질문  
SiRiUS 테이블 상하폭이 늘어나요... ㅠ_ㅠ [3] 2007.08.10
장우 서버시간과 시차 [1] 2007.08.10
임정현 FTP는 되는데, 홈피 출력이 안될경우.... [1] 2007.08.10
sont verdana폰트, 윈도우 기본폰트 맞나요? [2] 2007.08.10
용덕현 IIs에서 php사용시 php 가 먹통이 되는현상 때문에 질문드립니다. [1] 2007.08.10
風魄 또 하나의 질문 더 있습니다. [2] 2007.08.10
風魄 앞페이지의 체크된 것만 받아와서 뿌리려는데 안되여 고수님들의 조언 부탁드립니다  
김명철 trailing slash redirecting 질문이요~  
한승진 자바스크립트와 PHP의 변수 연계성 [3] 2007.08.10
yoonina 홈 관련 질문입니다. [2] 2007.08.10
임경진 그림이 깨져요..  
야호미 롤오버에 대한 질문입니다... [10] 2007.08.10
Metal_Midi php,플래시 연동에서 한글이 깨짐........(해결됨) [6] 2007.08.10
물탱이 서브레이어를 가운데서부터 위치지정.. [3] 2007.08.10
Outsider-Yun 폼을 통한 변수의 전달! [7] 2007.08.10
NZEO행동대장 asp 와 php 중에서... 구지 따지자면 어느것이 나을까요 [7] 2007.08.10
차준호 [질문] 테이블 셀의 높이 고정 [2] 2007.08.10
차준호 다시 질문합니다 [1] 2007.08.10
신중구 아이프레임에서 스크롤바의 색상을 바꿀수는 없나요? [3] 2007.08.10
신경만 왕초보 입니다. 참을성을 발휘해 주세요 제발 조그마한 답글이라도.. [4] 2007.08.10
susiah 테이블 배경을 고정시키기.... 질문입니다. [2] 2007.08.10
임경진 롤오버 문제.. [1] 2007.08.10
물탱이 엔지오식 메뉴 만들기에서.. 레이어 상대위치 지정 [1] 2007.08.10