-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpic.php
40 lines (35 loc) · 1.07 KB
/
pic.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
<?php
define('UPLOAD', dirname(__FILE__) . '/upload');
if (isset($_FILES["file"])) {
move_uploaded_file($_FILES["file"]["tmp_name"], UPLOAD . '/' . $_FILES["file"]["name"]);
}
?>
<html>
<head>
<title>求是潮技术大赛 - 图片管理系统</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link href="http://fonts.googleapis.com/css?family=Press+Start+2P|VT323" rel="stylesheet" type="text/css">
<link href="style.css" rel="stylesheet" type="text/css">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
</head>
<body>
<div id="content">
<h1>QSCTech</h1>
<p>Current image on the server:</p>
<p><ol>
<?php
$files = scandir(UPLOAD);
foreach ($files as $file) {
if (preg_match('/\.jpe?g$/i', $file))
echo "<li><a href='upload/$file'>$file</a></li>";
}
?>
</ol></p>
<p>Upload your image here:</p>
<form action="pic.php" method=POST enctype="multipart/form-data">
<label for="file">File:</label><input type="file" name="file" accept="image/jpeg">
<input type="submit" name="submit" value="Upload">
</form>
</div>
</body>
</html>