-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmessage_response_form.php
More file actions
90 lines (85 loc) · 2.52 KB
/
message_response_form.php
File metadata and controls
90 lines (85 loc) · 2.52 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Youth Is A Travel</title>
<link rel="stylesheet" type="text/css" href="./css/common.css">
<link rel="stylesheet" type="text/css" href="./css/message.css">
<script>
function check_input() {
if (!document.message_form.subject.value)
{
alert("제목을 입력하세요!");
document.message_form.subject.focus();
return;
}
if (!document.message_form.content.value)
{
alert("내용을 입력하세요!");
document.message_form.content.focus();
return;
}
document.message_form.submit();
}
</script>
</head>
<body>
<header>
<?php include "header.php";?>
</header>
<section id="main">
<div id="message_box">
<h3 id="write_title">
답변 쪽지 보내기
</h3>
<?php
$num = $_GET["num"];
$con = mysqli_connect("localhost", "user1", "12345", "sample");
$sql = "select * from message where num=$num";
$result = mysqli_query($con, $sql);
$row = mysqli_fetch_array($result);
$send_id = $row["send_id"];
$rv_id = $row["rv_id"];
$subject = $row["subject"];
$content = $row["content"];
$subject = "RE: ".$subject;
$content = "> ".$content;
$content = str_replace("\n", "\n>", $content);
$content = "\n\n\n-----------------------------------------------\n".$content;
$result2 = mysqli_query($con, "select name from members where id='$send_id'");
$record = mysqli_fetch_array($result2);
$send_name = $record["name"];
?>
<form name="message_form" method="post" action="message_insert.php?send_id=<?=$userid?>">
<input type="hidden" name="rv_id" value="<?=$send_id?>">
<div id="write_msg">
<ul>
<li>
<span class="col1">보내는 사람 : </span>
<span class="col2"><?=$userid?></span>
</li>
<li>
<span class="col1">수신 아이디 : </span>
<span class="col2"><?=$send_name?>(<?=$send_id?>)</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>
</ul>
<button type="button" onclick="check_input()">보내기</button>
</div>
</form>
</div> <!-- message_box -->
</section>
<footer>
<?php include "footer.php";?>
</footer>
</body>
</html>