-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathboard_modify_form.php
89 lines (86 loc) · 2.58 KB
/
board_modify_form.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
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>게시판 > 새 글 쓰기</title>
<link rel="stylesheet" type="text/css" href="./css/common.css">
<link rel="stylesheet" type="text/css" href="./css/board.css">
<script type="text/javascript" src="./ckeditor/ckeditor.js"></script>
<script type="text/javascript">
function LoadPage() {
CKEDITOR.replace('content');
}
</script>
<script>
function check_input() {
if (!document.board_form.subject.value)
{
alert("제목을 입력하세요!");
document.board_form.subject.focus();
return;
}
if (!document.board_form.content.value)
{
alert("내용을 입력하세요!");
document.board_form.content.focus();
return;
}
document.board_form.submit();
}
</script>
</head>
<?php require('dark.php'); ?>
<body style="background-color: <?php echo $background;?>; color: <?php echo $color;?>">
<header>
<?php include "header.php";?>
</header>
<section>
<div id="board_box">
<h3 id="board_title">
게시판 > 글 수정 - Indie, GO!
</h3>
<?php
$num = $_GET["num"];
$page = $_GET["page"];
$con = mysqli_connect("localhost", "Steve", "Vrick2956!@", "Term");
$sql = "select * from board where num=$num";
$result = mysqli_query($con, $sql);
$row = mysqli_fetch_array($result);
$name = $row["name"];
$subject = $row["subject"];
$content = $row["content"];
$file_name = $row["file_name"];
?>
<form id="EditorForm" name="board_form" method="post" action="board_modify.php?num=<?=$num?>&page=<?=$page?>" enctype="multipart/form-data">
<ul id="board_form">
<li>
<span class="col1">이름 : </span>
<span class="col2"><?=$name?></span>
</li>
<li>
<span class="col1">제목 : </span>
<span class="col2"><input name="subject" type="text" value="<?=$subject?>"></span>
</li>
<li id="text_area">
<span class="col1">내용 : </span>
<span class="col2">
<textarea name="content"><?=$content?></textarea>
</span>
</li>
<li>
<span class="col1"> 첨부 파일 : </span>
<span class="col2"><?=$file_name?></span>
</li>
</ul>
<ul class="buttons">
<li><button type="button" onclick="CKEDITOR.instances.content.updateElement(); check_input()">수정하기</button></li>
<li><button type="button" onclick="location.href='board_list.php'">목록</button></li>
</ul>
</form>
</div>
</section>
<footer>
<?php include "footer.php";?>
</footer>
</body>
</html>