-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuploadcover.html
106 lines (86 loc) · 4.82 KB
/
uploadcover.html
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<!doctype>
<html>
<head>
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="msapplication-tap-highlight" content="no" />
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width" />
<!-- This is a wide open CSP declaration. To lock this down for production, see below. -->
<meta http-equiv="Content-Security-Policy" content="default-src * 'unsafe-inline'; style-src 'self' 'unsafe-inline'; media-src *" />
<!-- Good default declaration:
* gap: is required only on iOS (when using UIWebView) and is needed for JS->native communication
* https://ssl.gstatic.com is required only on Android and is needed for TalkBack to function properly
* Disables use of eval() and inline scripts in order to mitigate risk of XSS vulnerabilities. To change this:
* Enable inline JS: add 'unsafe-inline' to default-src
* Enable eval(): add 'unsafe-eval' to default-src
* Create your own at http://cspisawesome.com
-->
<!-- <meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: 'unsafe-inline' https://ssl.gstatic.com; style-src 'self' 'unsafe-inline'; media-src *" /> -->
<link rel="stylesheet" type="text/css" href="css/main.css"/>
<!--<link rel="stylesheet" type="text/css" href="css/create.css"/>-->
<link rel="stylesheet" type="text/css" href="css/materialize.min.css"/>
<link rel="stylesheet" type="text/css" href="css/font-awesome.min.css"/>
<title>Hello World</title>
</head>
<body class="blue-grey lighten-4">
<div class="navbar-fixed">
<nav class="blue-grey darken-3">
<div class="nav-wrapper">
<a href="#" class="brand-logo" style="font-size:20px;">Upload cover picture</a>
<ul class="left"><a href="profile.html" data-activates="slide-out" class="button-collapse"><i class="fa fa-angle-left"></i></a></ul>
</div>
</nav>
</div>
<div class="" style="width:90%;margin: 15% auto;">
<div class="" style="">
<form method="POST" type="multipart/form-data">
<div class="file-field input-field">
<div class="btn blue-grey">
<span>File</span>
<input type="file" id="image" name="image">
</div>
<div class="file-path-wrapper">
<input class="file-path Validate" type="text" placeholder="Upload your cover image">
</div>
</div>
<button type="button" value="create" class="btn waves-effect waves-light blue-grey" id="cover">upload</button>
</form>
</div>
</div>
<script src="js/jquery-3.2.1.min.js"></script>
<script src="js/materialize.min.js"></script>
<script> $(document).ready(function(){
$("#cover").click(function(){
var image = $("#image").val();
//var formData = new FormData();
//formData.append('image', document.getElementById("image").files[0]);
var formData = new FormData($('form')[0]);
if (image != "" ) {
$.ajax({
type: 'post',
url: 'http://gothere.000webhostapp.com/uploadcover.php',
//url: 'uploadprofile.php',
data: formData,
contentType: false,
processData: false,
success:function(response) {
Materialize.toast("Picture uploaded", 5000);
window.location.href="profile.html";
/* if (response == "success") {
Materialize.toast("Picture uploaded", 10000);
}
else {
Materialize.toast("Picture not uploaded", 10000);
}*/
}
});
}
else {
Materialize.toast("Select a picture", 10000);
}
});
});
// window.location.href="index.html";
</script>
</body>
</html>