<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
</head>
<body>
<form action="upload.php" enctype="multipart/form-data" method="post">
<input type="file" name="file"/><br/>
<input type="submit"/>
</form>
</body>
</html>
//upload.php
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>显示上传文件信息</title>
</head>
<body>
<?php
// print_r($_FILES['file']);exit;
$file=$_FILES['file'];
$filename=$file['name'];
move_uploaded_file($file['tmp_name'],$filename);
echo "<img src='$filename'/>";
?>
</body>
</html>