-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupload_page.php
More file actions
133 lines (113 loc) · 3.39 KB
/
upload_page.php
File metadata and controls
133 lines (113 loc) · 3.39 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Upload Files</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.container {
max-width: 400px;
background-color: #fff;
padding: 20px;
border-radius: 10px;
box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
}
h1 {
color: #333;
text-align: center;
margin-bottom: 20px;
}
form {
display: flex;
flex-direction: column;
}
label {
margin-bottom: 10px;
font-weight: bold;
}
input[type="file"] {
margin-bottom: 15px;
padding: 10px;
border: 1px solid #ddd;
border-radius: 5px;
cursor: pointer;
}
input[type="submit"] {
padding: 10px;
background-color: #5cb85c;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 16px;
}
input[type="submit"]:hover {
background-color: #4cae4c;
}
button {
padding: 10px 20px;
background-color: #007bff;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 16px;
margin: 10px 0;
}
button:hover {
background-color: #0056b3;
}
</style>
</head>
<body>
<div class="container">
<h1>Upload Files</h1>
<form action="upload.php" method="post" enctype="multipart/form-data" id="uploadForm">
<div id="fileInputs">
<label for="file1">Select new file:</label>
<input type="file" name="file[]" id="file1"><br>
<label for="file2">Select file to append:</label>
<input type="file" name="file[]" id="file2"><br>
</div>
<button type="button" onclick="addFileInput()">Add More File</button>
<input type="submit" value="Upload Files" name="submit">
<button type="button" onclick="window.location.href = 'pjr_sow_dashboard.php'">Back</button>
</form>
</div>
<script>
let fileCount = 3;
function addFileInput() {
// Create a new div to hold the new input
const newFileDiv = document.createElement("div");
// Create the label for the new file input
const newLabel = document.createElement("label");
newLabel.setAttribute("for", `file${fileCount}`);
newLabel.textContent = `Select additional file ${fileCount}:`;
// Create the new file input
const newFileInput = document.createElement("input");
newFileInput.type = "file";
newFileInput.name = "file[]";
newFileInput.id = `file${fileCount}`;
// Add a line break for spacing
const lineBreak = document.createElement("br");
// Append the label, input, and line break to the new div
newFileDiv.appendChild(newLabel);
newFileDiv.appendChild(newFileInput);
newFileDiv.appendChild(lineBreak);
// Append the new div to the fileInputs container
document.getElementById("fileInputs").appendChild(newFileDiv);
// Increment the file count for unique IDs
fileCount++;
}
</script>
</body>
</html>