1 / 11

웹 사이트 제작 완성

17 장. 웹 사이트 제작 완성. 학습 목표. 공지사항 게시판에서 최근 글을 추출하는 법을 익힌다 자유게시판에서 최근 글을 추출하는 법을 익힌다 설문조사를 메인화면에서 작동시키는 법을 익힌다. 주요 학습 내용. 01. 초기 메인 화면 수정 02. 프레임 틀 수정 03. 웹 사이트 완성. 완성된 메인 하단 프레임 미리 보기. 01. [ 그림 17-1] 완성된 하단 프레임 (main.php) 화면. 【 예제 17-1】 main.php. 02.

Download Presentation

웹 사이트 제작 완성

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 17장 웹 사이트 제작 완성 한빛미디어(주)

  2. 학습 목표 • 공지사항 게시판에서 최근 글을 추출하는 법을 익힌다 • 자유게시판에서 최근 글을 추출하는 법을 익힌다 • 설문조사를 메인화면에서 작동시키는 법을 익힌다

  3. 주요 학습 내용 01. 초기 메인 화면 수정 02. 프레임 틀 수정 03. 웹 사이트 완성

  4. 완성된 메인 하단 프레임 미리 보기 01 [그림 17-1] 완성된 하단 프레임(main.php) 화면

  5. 【예제 17-1】main.php 02 • 완성된 하단 프레임 1 : <? 2 :include "dbconn.php"; 4 :$sql = "select * from notice_board order by num desc limit 4"; 5 :$result_notice = mysql_query($sql, $connect); 6 : 7 :$sql = "select * from freeboard order by num desc limit 4"; 8 : $result_freeboard = mysql_query($sql, $connect); 10 : ?> 11 : <html> 12 : <head> 13 : <title> :: PHP 프로그래밍 입문에 오신 것을 환영합니다~~ :: </title> 14 : <link rel="stylesheet" href="style.css" type="text/css"> 15 : 16 : <script>

  6. 【예제 17-1】main.php 02 17 :function update() 18 : { 19 : var vote; 20 : var length = document.survey_form.singer.length; 21 : 22 :for (var i=0; i<length; i++) 23 :{ if (document.survey_form.singer[i].checked == true) 25 : { vote= document.survey_form.singer[i].value; 27 : break; 28 : } 29 : } 30 : 31 : if (i == length) 32 :{ alert("항목을 선택하세요!"); 34 : return; 35 :}

  7. 【예제 17-1】main.php 02 37 : window.open("survey/update.php?singer="+vote , "updatewin", 38 : "left=200, top=200, width=180, height=250, status=no, scrollbars=no"); 39 : } 40 : 41 : function result() 42 : { 43 : window.open("survey/result.php" , "updatewin", 44 : "left=200, top=200, width=180, height=250, status=no, scrollbars=no"); 45 :} 46 : </script> 47 : </head> 49 : <body leftmargin="0" topmargin="0" marginwidth="0“ marginheight="0">

  8. 【예제 17-1】main.php 02 70 : <? // 공지사항 최근 글 출력 71 :while ($row = mysql_fetch_array($result_notice)) 72 :{ 74 : echo " 75 : <tr> 76 : <td height='26' valign='center'>&nbsp;&nbsp; 77 : <img src='img/point.gif' width='5' height='9' border='0' 78 : style='cursor:hand'> 79 : <a href='notice/view.php?num=$row[num]'>$row[subject] </a></td> 80 : </tr> 81 : <tr> 82 : <td bgcolor='#CAC9C9' height='1'></td> 83 : </tr> 84 : "; 85 :} 86 : ?>

  9. 【예제 17-1】main.php 02 102 : <? // 자유게시판 최근 글 출력 103 :while ($row = mysql_fetch_array($result_freeboard)) 104 : { 106 :echo " 107 : <tr> 108 : <td height='26' valign='center'>&nbsp;&nbsp; 109 : <img src='img/point.gif' width='5' height='9' border='0' 110 : style='cursor:hand'> 111 : <a href='freeboard/view.php?num=$row[num]'>$row[subject] </a></td> 112 : </tr> 113 : <tr> 114 : <td bgcolor='#CAC9C9' height='1'></td> 115 : </tr> 116 : "; 117 : } 118 : ?>

  10. 【예제 17-2】index.php 02 • 프레임 틀 수정 1 : <html> 2 : <head> 3 : <meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ks_c_5601-1987"> 4 : <title>:: PHP 프로그래밍 입문에 오신 것을 환영합니다~~ ::</title> 5 : </head> 6 : 7 : <frameset framespacing="0" border="0" frameborder="0" rows="210,*"> 8 : <frame name="top" src="top.php" scrolling="auto" noresize> 9 : <frame name="main" src="main.php" scrolling="auto" noresize> 10 : </frameset> 11 : 12 : </html>

  11. 완성된 웹 사이트 02 [그림 17-2] 완성된 웹 사이트

More Related