-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpost.php
More file actions
152 lines (143 loc) · 5.4 KB
/
Copy pathpost.php
File metadata and controls
152 lines (143 loc) · 5.4 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<?php
include 'config.php';
include 'headers.php';
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<title>Completely Digital Clips - Post Video</title>
<!-- Bootstrap core CSS -->
<link href="/static/css/bootstrap.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->
<!-- Custom styles for this template -->
<link href="/static/css/carousel.css" rel="stylesheet">
<script src="/lib/jquery.js"></script>
<script src="/static/js/bootstrap.min.js"></script>
</head>
<!-- NAVBAR
================================================== -->
<body>
<div class="navbar-wrapper">
<div class="container">
<div class="navbar navbar-inverse navbar-static-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Completely Digital Clips</a>
<?php echo "<!-- Hosted by $APPLICATION_HOSTNAME -->"; ?>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li><a href="/index.php">Home</a></li>
<?php if(isset($_COOKIE["PHPSESSID"])): ?>
<li><a href="/post.php">Post Video</a></li>
<li><a href="/logout.php">Logout</a></li>
<?php else: ?>
<li><a href="/login.php">Login</a></li>
<li><a href="/registration.php">Register</a></li>
<?php endif; ?>
</ul>
</div>
</div>
</div>
</div>
</div>
<br />
<div class="container marketing">
<hr class="featurette-divider">
<h1>Post Video</h1>
<script>
function getFilesize(fileid) {
try {
var fileSize = 0;
if(checkIE() != 0) {
var objFSO = new ActiveXObject("Scripting.FileSystemObject"); var filePath = $("#" + fileid)[0].value;
var objFile = objFSO.getFile(filePath);
var fileSize = objFile.size; //size in kb
fileSize = fileSize / 1048576; //size in mb
} else {
fileSize = $("#" + fileid)[0].files[0].size //size in kb
fileSize = fileSize / 1048576; //size in mb
}
return fileSize;
} catch (e) {
// alert("Error is :" + e);
}
}
function checkIE() {
var ua = window.navigator.userAgent;
var msie = ua.indexOf("MSIE ");
if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)){
return parseInt(ua.substring(msie + 5, ua.indexOf(".", msie)));
} else {
return 0;
}
return false;
}
function checkPostVideo(){
if (document.postvideo.title.value.length==0){
alert("Please enter title!");
return false;
}
if(document.postvideo.description.value.length==0){
alert("Please enter description!");
return false;
}
if(document.postvideo.video.value.length==0){
alert("Please select a video to upload!");
return false;
}
if(getFilesize("video") > 100){
alert("Video is too large to upload!");
return false;
}
return true;
}
</script>
<br />
<font face="verdana" color="red">
<?php
if(isset($_GET["message"])) {
echo "<p>Post Failed</p>";
echo "<p>" . $_GET["message"] . "</p>";
}
?>
</font>
<form name=postvideo action="upload.php" method="post" enctype="multipart/form-data" onSubmit="return checkPostVideo();">
<label for="title">Title</label><br />
<input type="text" name="title"><br />
<br />
<label for="description">Description</label><br />
<textarea name="description" id="description"></textarea>
<br />
<br />
<label for="video">Video File</label><br />
<input type="file" name="video" id="video">
<br />
<input value="Post" type="submit">
</form>
<br />
<!-- FOOTER -->
<hr class="featurette-divider">
<footer>
<p>© <?php echo date("Y"); ?> Completely Digital Clips · <a href="/privacy.php">Privacy</a> · <a href="/terms.php">Terms</a></p>
</footer>
</div>
</body>
</html>