-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadd_image.php
More file actions
49 lines (42 loc) · 1.54 KB
/
add_image.php
File metadata and controls
49 lines (42 loc) · 1.54 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
<?php
session_start();
if (!isset($_SESSION['username'])) {
header('Location: login.php');
exit;
}
require_once __DIR__ . '/includes/Database.php';
$type = $_GET['type'] ?? '';
$id = $_GET['id'] ?? '';
if (!in_array($type, ['element', 'theme', 'biocultural']) || !is_numeric($id)) {
die('Incorrect data source.');
}
?>
<!DOCTYPE html>
<html lang="pl">
<head>
<meta charset="UTF-8">
<title>Add image</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="page-container">
<h1>Add image to: <?= htmlspecialchars($type) ?> (ID: <?= htmlspecialchars($id) ?>)</h1>
<form action="save_image.php" method="post" enctype="multipart/form-data" class="form-box responsive-form">
<input type="hidden" name="type" value="<?= htmlspecialchars($type) ?>">
<input type="hidden" name="id" value="<?= htmlspecialchars($id) ?>">
<div class="form-group full-width">
<label for="image">Select file</label>
<input type="file" name="image" id="image" accept="image/*" required>
</div>
<div class="form-group full-width">
<label for="description">Description (optional)</label>
<textarea name="description" id="description" rows="4"></textarea>
</div>
<div class="form-actions">
<button type="submit" class="btn-link">📷 Add image</button>
<a href="javascript:history.back()" class="btn-link">⬅ Return</a>
</div>
</form>
</div>
</body>
</html>