register.html 1.73 KB
<!doctype html>
<title>Web Attendance System Register</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Nanum+Gothic:400,700,800&amp;subset=korean">
<script type='text/javascript' src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<style>
body,h1,h2,h3,h4,h5 {font-family: "Nanum+Gothic", sans-serif}
</style>
<body class="w3-light-grey">

<!-- w3-content defines a container for fixed size centered content,
and is wrapped around the whole page content, except for the footer in this example -->
<div class="w3-content" style="max-width:1400px">

<!-- Header -->
<header class="w3-container w3-center w3-padding-32"> 
  <h1><b>얼굴 등록</b></h1>
  <p>Made by <span class="w3-tag">정해갑</span></p>
</header>

<div class="w3-row", style='text-align:center'>
	<h2><b>얼굴 파일을 등록해주세요 (jpeg only)</b></h2>
<form method="post" action="/register" enctype="multipart/form-data">
학번: <input type="text" name="student_id"><br>
이름: <input type="text" name="student_name"><br><br>
<input type="file" name="file" onchange="loadFile(event)" autocomplete="off" accept="image/jpeg" required>
<div>
<img id="preview">
</div>
<input type="submit" value="등록">
</form>
<script>
  var loadFile = function(event) {
    var output = document.getElementById('preview');
    var reader = new FileReader();
    reader.readAsDataURL(event.target.files[0]);
    reader.result;

    output.src = URL.createObjectURL(event.target.files[0]);
    output.onload = function() {
      URL.revokeObjectURL(output.src) // free memory
    }
  };
</script>
</div>