-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.php
More file actions
67 lines (57 loc) · 1.53 KB
/
test.php
File metadata and controls
67 lines (57 loc) · 1.53 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
<!DOCTYPE html>
<html>
<head>
<title>Favicon Creator</title>
<meta charset="utf-8">
<style type="text/css">
.main {
text-align: center;
}
</style>
</head>
<body>
<div class="main">
<h1>Favicon Creator</h1>
<!-- form -->
<form action="./test.php" method="POST" enctype="multipart/form-data">
<strong>Dimensions:</strong>
<br><br>
<select name="dimension">
<option value="16" selected>16px x 16px</option>
<option value="32">32px x 32px</option>
<option value="64">64px x 64px</option>
<option value="128">128px x 128px</option>
</select>
<br><br>
<strong>Image:</strong>
<br><br>
<input type="file" name="file" accept="image/*">
<br><br>
<input type="submit" name="submit" value="Convert">
</form>
<!-- page-refresh-button -->
<br><br>
<a href="./test.php">Refresh</a>
<br><br>
<!-- php-codes -->
<?php
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if (!empty($_FILES['file']['name'])) {
include('./creator.php');
$result = faviconCreator();
?>
<strong>Result:</strong>
<br><br>
<a href="<?=$result ?>" download="favicon.ico">Download your favicon...</a>
<br><br>
<strong>Using:</strong>
<pre><code><!-- In head tag --><br><link rel="icon" href="favicon.ico" type="image/x-icon"></code></pre>
<?php
} else {
echo('<strong>Error:</strong> Empty file!');
}
}
?>
</div>
</body>
</html>