Halo teman-teman semua, pada blog kali ini aku mau sedikit share cara aku bikin satu halaman login website sederhana, semoga bisa membantu teman-teman semua, maaf kalau kurang disini aku juga masih belajar, langsung aja...
Disini aku pake HTML, PHP dan CSS.
index.php
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>UTS</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="wrapper">
<div class="text-center mt-4 name"> <p align="center"> BACAYU!</p> </div>
<form action="login.php" method="POST">
<form class="p-3 mt-4">
<div class="form-field d-flex align-items-center"> <span class="far fa-user"></span> <input type="text" name="nama" id="nama" placeholder="Nama"> </div>
<div class="form-field d-flex align-items-center"> <span class="fas fa-key"></span> <input type="text" name="email" id="email" placeholder="Email"> </div>
<div class="form-field d-flex align-items-center"> <span class="fas fa-user"></span> <input type="text" name="judulbuku" id="judulbuku" placeholder="Judul Buku"> </div>
<button class="btn mt-3"> SUBMIT </button>
</form>
</form>
</div>
<style>
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@500&display=swap');
* {
font-family: 'Quicksand', Roboto;
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
background: #ecf0f3
}
.wrapper {
max-width: 350px;
min-height: 500px;
margin: 80px auto;
padding: 40px 30px 30px 30px;
background-color: #ecf0f3;
border-radius: 15px;
box-shadow: 13px 13px 20px #cbced1, -13px -13px 20px #fff
}
.wrapper .name {
font-weight: 600;
font-size: 4rem;
letter-spacing: 1.3px;
padding-left: 10px;
color: #555
}
.wrapper .form-field input {
width: 100%;
display: block;
border: none;
outline: none;
background: none;
font-size: 30 pt;
color: #666;
padding: 10px 15px 10px 10px
}
.wrapper .form-field {
padding-left: 10px;
margin-bottom: 20px;
border-radius: 20px;
box-shadow: inset 8px 8px 8px #cbced1, inset -8px -8px 8px #fff
}
.wrapper .form-field .fas {
color: rgb(34, 34, 34)
}
.wrapper .btn {
box-shadow: none;
width: 100%;
height: 40px;
background-color: #b8b8b8;
color: #fff;
border-radius: 25px;
box-shadow: 3px 3px 3px #b1b1b1, -3px -3px 3px #fff;
letter-spacing: 1.3px
}
.wrapper .btn:hover {
background-color: #0a0a0a
}
.wrapper a {
text-decoration: none;
font-size: 0.8rem;
color: #000000
}
@media(max-width: 380px) {
.wrapper {
margin: 30px 20px;
padding: 40px 15px 15px 15px
}
}
</style>
</body>
</html>
login.php<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="wrapper">
<div class="text-center mt-4 name"><h6><p align="center"> DATA PEMINJAM BUKU PERPUSTAKAAN </h6></p> </div>
<table class="styled-table">
<table border="2" width="450" cellpadding="2">
<thead>
<tr>
<td>Nama</td>
<td> : </td>
<td><?php echo $_POST['nama']?></td>
</tr>
<tr>
<td>Email</td>
<td> : </td>
<td><?php echo $_POST['email']?></td>
</tr>
<tr>
<td>Judul Buku</td>
<td> : </td>
<td><?php echo $_POST['judulbuku']?></td>
</tr>
</thead>
</tbody>
</table>
</table>
<style>
.styled-table {
border-collapse: collapse;
margin: 50px auto;
font-size: 0.5rem;
font-family: roboto;
min-width: 500px;
}
.wrapper {
max-width: 500px;
min-height: 100px;
margin: 80px auto;
padding: 40px 30px 30px 30px;
background-color: #ecf0f3;
border-radius: 15px;
box-shadow: 13px 13px 20px #cbced1, -13px -13px 20px #fff
</style>
</body>
</html>
No comments:
Post a Comment