-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathread.php
More file actions
96 lines (94 loc) · 3.81 KB
/
Copy pathread.php
File metadata and controls
96 lines (94 loc) · 3.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?php
include $_SERVER['DOCUMENT_ROOT']."/practice/db2.php"; /* db load */
?>
<!doctype html>
<head>
<meta charset="UTF-8">
<title>게시판</title>
<link rel="stylesheet" type="text/css" href="/practice/css/jquery-ui.css" />
<link rel="stylesheet" type="text/css" href="/practice/css/style.css" />
<script type="text/javascript" src="/practice/js/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="/practice/js/jquery-ui.js"></script>
<script type="text/javascript" src="/practice/js/common.js"></script>
</head>
<body>
<?php
$bno = $_GET['idx']; /* bno함수에 idx값을 받아와 넣음*/
$hit = mysqli_fetch_array(mq("select * from board where idx ='".$bno."'"));
$hit = $hit['hit'] + 1;
$fet = mq("update board set hit = '".$hit."' where idx = '".$bno."'");
$sql = mq("select * from board where idx='".$bno."'"); /* 받아온 idx값을 선택 */
$board = $sql->fetch_array();
?>
<!-- 글 불러오기 -->
<div id="board_read">
<h2><?php echo $board['title']; ?></h2>
<div id="user_info">
<?php echo $board['name']; ?> <?php echo $board['date']; ?> 조회:<?php echo $board['hit']; ?>
<div id="bo_line"></div>
</div>
<div id="bo_content">
<?php echo nl2br("$board[content]"); ?>
</div>
<div>
파일 : <a href="../../upload/<?php echo $board['file'];?>" download><?php echo $board['file']; ?></a>
</div>
</div>
<!-- 목록, 수정, 삭제 -->
<div id="bo_ser">
<ul>
<li><a href="index.php">[목록으로]</a></li>
<li><a href="thumbup.php?idx=<?php echo $board['idx']; ?>">[추천]</a></li>
<li><a href="modify.php?idx=<?php echo $board['idx']; ?>">[수정]</a></li>
<li><a href="delete.php?idx=<?php echo $board['idx']; ?>">[삭제]</a></li>
</ul>
</div>
</div>
<!--- 댓글 불러오기 -->
<div class="reply_view">
<h3>댓글목록</h3>
<?php
$sql3 = mq("select * from reply where con_num='".$bno."' order by idx desc");
while($reply = $sql3->fetch_array()){
?>
<div class="dap_lo">
<div><b><?php echo $reply['name'];?></b></div>
<div class="dap_to comt_edit"><?php echo nl2br("$reply[content]"); ?></div>
<div class="rep_me dap_to"><?php echo $reply['date']; ?></div>
<div class="rep_me rep_menu">
<a class="dat_edit_bt" href="#">수정</a>
<a class="dat_delete_bt" href="#">삭제</a>
</div>
<!-- 댓글 수정 폼 dialog -->
<div class="dat_edit">
<form method="post" action="reply_modify_ok.php">
<input type="hidden" name="rno" value="<?php echo $reply['idx']; ?>" /><input type="hidden" name="b_no" value="<?php echo $bno; ?>">
<input type="password" name="pw" class="dap_sm" placeholder="비밀번호" />
<textarea name="content" class="dap_edit_t"><?php echo $reply['content']; ?></textarea>
<input type="submit" value="수정하기" class="re_mo_bt">
</form>
</div>
<!-- 댓글 삭제 비밀번호 확인 -->
<div class='dat_delete'>
<form action="reply_delete.php" method="post">
<input type="hidden" name="rno" value="<?php echo $reply['idx']; ?>" /><input type="hidden" name="b_no" value="<?php echo $bno; ?>">
<p>비밀번호<input type="password" name="pw" /> <input type="submit" value="확인"></p>
</form>
</div>
</div>
<?php } ?>
<!--- 댓글 입력 폼 -->
<div class="dap_ins">
<input type="hidden" name="bno" class="bno" value="<?php echo $bno; ?>">
<input type="text" name="dat_user" id="dat_user" class="dat_user" size="15" placeholder="아이디">
<input type="password" name="dat_pw" id="dat_pw" class="dat_pw" size="15" placeholder="비밀번호">
<div style="margin-top:10px; ">
<textarea name="content" class="reply_content" id="re_content" ></textarea>
<button id="rep_bt" class="re_bt">댓글</button>
</div>
</div>
</div><!--- 댓글 불러오기 끝 -->
<div id="foot_box"></div>
</div>
</body>
</html>