-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathread.php
39 lines (39 loc) · 1.23 KB
/
read.php
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
<?php
include $_SERVER['DOCUMENT_ROOT']."/db.php"; /* db load */
?>
<!doctype html>
<head>
<meta charset="UTF-8">
<title>게시판</title>
<link rel="stylesheet" type="text/css" href="/css/style.css" />
</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 id="bo_ser">
<ul>
<li><a href="/">[목록으로]</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>
</body>
</html>