-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo13.php
67 lines (61 loc) · 2.05 KB
/
demo13.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<?php
$Name = $_POST["name"];
$school = $_POST["school"];
$xingbie = $_POST["xingbie"];
$name = $_FILES["file"]["name"];
$lujing = "./img/$name";
if (isset($name)) {
$tmplj = $_FILES["file"]["tmp_name"];
$size = $_FILES["file"]["size"];
$errot = $_FILES["file"]["errot"];
$type = $_FILES["file"]["type"];
$suffix = substr($type, strrpos($type, '/') + 1);
// echo $type;
// echo $suffix;
if ($suffix == "png" || $suffix == "jpg" || $suffix == "jpeg") {
move_uploaded_file($_FILES["file"]["tmp_name"], './img/' . $_FILES["file"]["name"]);
// echo $_FILES["img"];
// echo "上传文件名: " . $_FILES["file"]["name"] . "<br>";
// echo "文件类型: " . $_FILES["file"]["type"] . "<br>";
// echo "文件大小: " . ($_FILES["file"]["size"] / 1024) . " kB<br>";
// echo "文件存储的位置: " . $tmplj;
} else {
echo "错误," . $size . "kb" . '<br>';
}
}
?>
<table>
<thead>
<div>
<div>
<table>
<tr>
<td>姓名</td>
<td><?php echo $Name; ?></td>
</tr>
<tr>
<td>院校</td>
<td><?php echo $school; ?></td>
</tr>
<tr>
<td>性别</td>
<td><?php echo $xingbie; ?></td>
</tr>
</table>
</div>
<div>
<img style="width: 300px;height: 300px; overflow: hidden;" src="<?php echo $lujing ?>">
</div>
</div>
</thead>
</table>
</body>
</html>