-> 문제의 설문조사 추출입니다...

2004.10.09
<?
//---------------------------------------------------
$filename=realpath(__FILE__);
$config_dir=eregi_replace("vote.php","",$filename);
require "$config_dir"."dbconn.php";
$id     = "voot"; //게시판이름
$title_leg  = "45";   //설문조사 제목 길이
$log_image  = "http://dowkorea.co.kr/vote/img";  //이미지 경로

$connect = mysql_connect($host_name,$user_name,$db_password);
mysql_select_db($db_name);

echo"<STYLE TYPE='text/css'>
         A.menu:link {color: 666666; text-decoration: none;}
        A.menu:visited {color: 666666; text-decoration: none;}
        A.menu:hover {color:666666; text-decoration: none;}
        BODY,TABLE,TR,TD,table{font-size:9pt; color: CFCFCF; font-family:웹정;}
        BODY
     </style>
     <script>
        function check_survey_submit()
        {
                var check=0;
                for(i=0;i<main_survey.sub_no.length;i++)
                {
                        if(main_survey.sub_no[i].checked) {check=1;}
                }
                if(check<1) {alert('투표할 메뉴를 선택하세요)'); return false;}
                return true;
        }
     </script>

<table align=center border=0 cellpadding=0 cellspacing=0 width=150>
   <tr>
<td width=150 colspan=3></td>
</tr>
    <tr>
        
        <td width=145>
           <table align=center border=0 cellpadding=0 cellspacing=0>";
     $result=mysql_query("select * from zetyx_board_$id where prev_no=0 order by arrangenum asc") or die(mysql_error());

for($i=0; $i < $data=mysql_fetch_array($result); $i++)
{
        //제목 자르기
        $title_cut="$data[subject]";
        $title_leg2=strlen($title_cut);
          for($k=0; $k<$title_leg-1; $k++)
          {
             if(ord(substr($title_cut, $k, 1))>127) $k++;
             }
             if ($title_leg2 > $title_leg)
                {
                $title_cutt=substr($title_cut, 0, $k)."...";
                }
                else { //자른 값보다 작으면 원래대로
                $title_cutt=$title_cut;
          }

  if($i==0)
        {
         $no=$data[no];
         echo "
           <tr>

                 <td width=145><p style=line-height:150%; margin-top:0; margin-bottom:0;> $title_cutt</td>
           </tr>
           <tr>
                  <td></td>
           </tr>
           <tr>
                  <td></td>
           </tr>
                 ";
         echo "<form method=post action=$zero_path/"."apply_vote.php name=main_survey onsubmit='return check_survey_submit()' target=_parent>
               <input type=hidden name=id value=$id>
               <input type=hidden name=no value=$no>";
  }else{
         $sub_no=$no+$i; //위에서 정해준 no에 현재 i의 값을 더해서 sub_no에 넣어줌.
         echo "
                         <tr>
                       <td width=145><input type=radio name=sub_no value=$sub_no onfocus=blur()> $title_cutt </td>

                         </tr>
                         <tr>
               <td colspan=2></td>
             </tr>";
  }
}//for문

echo "
</table>
        </td>
      
    </tr>
    <tr>
        <td width=145>
            <table align=center>
<tr>
<td colspan=2 height=36 ><p align=center>
<input type='image' style='cursor:hand' src=$log_image/"."vote1.gif onfocus=blur() target=_parent>   <a href=$zero_path/"."view.php?id=$id&no=$no style='cursor:hand' onfocus=blur() target=_parent class=menu><img src=$log_image/"."vote2.gif border=0></a>
</td>
</tr>
</form>
</table>
        </td>
    </tr>
    
</table>";
mysql_close();
?>

List of Articles
번호 제목 글쓴이 날짜 조회 수
1292 질문이있는데요... Sverd 2003.01.24 6721
1291 안녕하세혀? ^0^;; 음악태그에 관해서..(인사차질문 ^^) 2 rulrulara 2003.01.24 6603
1290 안녕하세요... 홍석만 2003.01.24 6590
1289 근데요..... 1 홍석만 2003.01.24 4894
1288 저기요.... 정혜린 2003.01.25 4941
1287 이미지 저장을 완벽하게 막는 방법은 없을까요 ? 1 박제현 2003.01.31 4726
1286 안녕하세요~^^ 1 이옥현 2003.02.03 6765
1285 홈피 테두리 사이즈는 어케 조정하는지요? 2 정성희 2003.02.05 4244
1284 wo.to 같은 주소 짧게 해주는곳 중에 2 루팡30 2003.02.06 3255
1283 넘 간단한 질문인가..ㅡㅡ;게시판에 관해.. 1 팔콘213 2003.02.07 2884
1282 최근게시물... 2 yjylove 2003.02.08 2935
1281 최근게시물에 관한 질문입니다~!! 제발 필독!! 2 『PDS.K』 2003.02.09 3380
1280 게시판넣을때 .. 3 오유 2003.02.09 3003
1279 스킨질문~ 1 물고기 2003.02.10 2269
1278 도와주세요..최근게시물.. 2 yjylove 2003.02.11 2742
1277 최근게시물 제목 질문 ! 꼭 좀 ~ 1 아짱이 2003.02.11 2239
1276 최근 게시물 스킨에서 날짜 모양 바꾸는 법 좀 알려주세요 1 이덕수 2003.02.14 2224
1275 나모에 클립아트가 없어요(-_-;;) 1 우라누스03 2003.02.19 2041
1274 노프레임첫페이지에서 일반게시물 출력 -_-;; 2 하종근 2003.02.19 14
1273 최근게시물때문에요. 2 음.. 2003.02.19 2006
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 65 Next
/ 65