Repository navigation
Expand file tree
/
Copy pathgive1.html
More file actions
68 lines (65 loc) ยท 2.5 KB
/
Copy pathgive1.html
File metadata and controls
68 lines (65 loc) ยท 2.5 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
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="../css/default.css">
<link rel="stylesheet" href="../css/style.css?ver=18">
<title>๋ถ์ค๋ฌผ ์ ๊ณ </title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$.get("http://15.164.210.143/give2.php", function(data, status){
// 'data' contains the output of board.php
$("#result").html(data);
})
.fail(function(jqXHR, textStatus, errorThrown) {
console.error('AJAX request failed: ' + textStatus + ', ' + errorThrown);
});
});
</script>
</head>
<body>
<form id="myForm" action="#" method="POST" enctype="multipart/form-data">
<section>
<div class="mainCon">
<div class="writeTitle">๋ถ์ค๋ฌผ ์ ๊ณ </div>
<input class="writeTypeText" type="text" name="title" size="50" placeholder="์ ๋ชฉ์ ์
๋ ฅํด์ฃผ์ธ์" required></p>
<textarea class="writeTextarea" name="story" placeholder="๋ณธ๋ฌธ์ ์
๋ ฅํด์ฃผ์ธ์" required></textarea>
<input type="file" name="image">
<input type="button" id="submit" value="์์ฑํ๊ธฐ">
<input type="button" value="์ทจ์" onclick="history.back(1)">
</div>
</section>
</form>
<!-- ์ ์ฅ๋ ์ด๋ฏธ์ง๋ฅผ ํ์ํ๋ ๋ถ๋ถ -->
<div id="imageDisplay">
</div>
<script>
$(document).ready(function () {
$("#submit").click(function () {
var formData = new FormData($("#myForm")[0]);
$.ajax({
url: 'http://15.164.210.143/give2.php',
type: 'POST',
data: formData,
processData: false,
contentType: false,
success: function (data) {
if (data.success) {
alert(data.success);
}
},
error: function (jqXHR) {
var errorData = JSON.parse(jqXHR.responseText);
if(errorData.error) {
alert(errorData.error);
} else {
alert('์ด๋ฏธ์ง ์
๋ก๋์ ์คํจํ์ต๋๋ค.');
}
}
});
});
});
</script>
</body>
</html>