html 기초 (전송)
페이지 정보
작성자 낙엽타는향기 댓글 0건 조회 3,691회 작성일 22-02-16 14:58본문
1. upload.html
[code]
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<form action="https://leaves.com/upload.php" method="post" enctype="multipart/form-data">
<input type="file" name="profile">
<input type="submit">
</form>
</body>
</html>
[/code]
2. 서버의 디렉토리에
upload.php를 생성하고
[code]
<?php
$source = $_FILES['profile']['tmp_name'];
$dest = "/var/www/html/kors/upload/".basename($_FILES['profile']['name']);
move_uploaded_file($source, $dest);
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<img src="<?=$_FILES['profile']['name']?>" alt="" />
</body>
</html>[/code]
댓글목록
등록된 댓글이 없습니다.