-
Notifications
You must be signed in to change notification settings - Fork 4
/
upload_logos.php
53 lines (42 loc) · 1.32 KB
/
upload_logos.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
<?php
header('Content-Type: text/html; charset=utf-8');
?>
<title>Upload Team Logo</title>
<script src="./js/lib/jquery-1.8.3.js"></script>
<script src="./parseRoster.js"></script>
<script src="./state_province.js"></script>
<h1>Upload Team Logo</h1>
<br>
<script>
window.onload = function() {
//this is all upload file stuff
//var url = document.URL.substring(0, document.URL.lastIndexOf("/")) + "/upload_file.php";
//when the document is finished loading, replace everything
//between the <a ...> </a> tags with the setValue of splitText
//document.getElementById("myurl").action=url;
}
</script>
<form id="myurl" action="" method="post" enctype="multipart/form-data">
<label for="file">Filename:</label>
<input type="file" name="file" id="file"><br>
<input type="submit" name="submit" value="Upload">
<hr>
<p></p>
<p></p>
</form>
<?php
include("init.php");
include("include.php");
function console_log($output, $with_script_tags = true) {
$js_code = 'console.log(' . json_encode($output, JSON_HEX_TAG) . ');';
if ($with_script_tags) {
$js_code = '<script>' . $js_code . '</script>';
}
echo $js_code;
}
if(isset($_POST['submit'])){
$filename = $_FILES['file']['name'];
// Upload file
move_uploaded_file($_FILES['file']['tmp_name'],'teamlogos/'.$_POST['team_sel'].$filename);
}
?>