-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathboard.php
More file actions
68 lines (67 loc) · 2.54 KB
/
Copy pathboard.php
File metadata and controls
68 lines (67 loc) · 2.54 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
<?php
include('./dbconfig.php');
session_start();
if(isset($_SESSION['id'])) {
echo("<script>window.location.href='#';</script>");
}else{
die("<script>window.location.href='./index.php';</script>");
}
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>세미콜론 웹 개발 프로젝트</title>
<link rel='stylesheet prefetch' href='https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.3.3/semantic.min.css'>
</head>
<body>
<div class="ui container" id="container">
<div class="ui basic segment" id="header">
<h1 class="ui icon header" style="text-align: left; margin-top: 50px;">
세미콜론 웹 개발 프로젝트
</h1>
<p>
<strong style="color:#EC655A;">일년동안 수고했어!</strong>
</p>
<form method="post" action="process.php">
<input name="cmd" value="0" type="hidden">
<button class="ui green submit button" style="float:right;" name="submit" type="submit">로그아웃</button>
</form>
</div>
<div class="ui raised segment">
<div class="ui attached message">
<div class="header">
세미콜론 게시판
</div>
</div>
<table class="ui unstackable table">
<thead>
<tr><th>제목</th>
<th>작성자</th>
<th>작성일</th>
</tr></thead>
<?php
$sql = mq("select * from board order by idx desc limit 0,5");
while($board = $sql->fetch_array()){
$title=$board['content'];
if(strlen($title)>30){
$title=str_replace($title,mb_substr($title,0,30,"utf-8")."...",$title);
}
?>
<tbody>
<tr>
<td data-label=""><a href="read.php?idx=<?php echo $board['idx']; ?>"><?php echo $title;?></a></td>
<td data-label=""><?php echo $board['id'];?></td>
<td data-label=""><?php echo $board['date']?></td>
</tr>
</tbody>
<?php } ?>
</table>
</div>
<button class="ui blue submit button" type="submit" onclick="window.location.href='write.php'">글쓰기</button>
</div>
<script src='https://code.jquery.com/jquery-3.3.1.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.3.3/semantic.min.js'></script>
</body>
</html>