1. Buat halaman dengan nama login.php
<!DOCTYPE html>
<html lang="id">
<head>
<meta charset="UTF-8">
<title>Login | SMK Bahtra Pandeglang</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
* {
box-sizing: border-box;
font-family: 'Segoe UI', Tahoma, sans-serif;
}
body {
margin: 0;
min-height: 100vh;
background: url("https://images.unsplash.com/photo-1588072432836-e10032774350") no-repeat center center/cover;
display: flex;
align-items: center;
justify-content: center;
}
/* Overlay gelap */
body::before {
content: "";
position: absolute;
inset: 0;
background: rgba(0, 0, 0, 0.55);
z-index: 0;
}
.login-box {
position: relative;
z-index: 1;
background: #ffffff;
width: 360px;
padding: 30px;
border-radius: 12px;
box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}
.login-box img {
width: 90px;
display: block;
margin: 0 auto 10px;
}
.login-box h2 {
text-align: center;
margin-bottom: 5px;
color: #2c3e50;
}
.login-box p {
text-align: center;
margin-bottom: 25px;
font-size: 14px;
color: #555;
}
.form-group {
margin-bottom: 15px;
}
.form-group label {
display: block;
font-size: 14px;
margin-bottom: 5px;
color: #333;
}
.form-group input {
width: 100%;
padding: 10px 12px;
border-radius: 8px;
border: 1px solid #ccc;
outline: none;
}
.form-group input:focus {
border-color: #007bff;
}
.btn-login {
width: 100%;
padding: 10px;
border: none;
border-radius: 8px;
background: #007bff;
color: #fff;
font-size: 15px;
cursor: pointer;
}
.btn-login:hover {
background: #0056b3;
}
.footer-text {
text-align: center;
font-size: 12px;
margin-top: 15px;
color: #777;
}
@media (max-width: 480px) {
.login-box {
width: 90%;
}
}
</style>
</head>
<body>
<div class="login-box">
<!-- Ganti logo sekolah -->
<img src="img/logo.png" alt="Logo SMK">
<h2>Login Sistem</h2>
<p>Website SMK Digital</p>
<!-- Nanti action bisa ke login.php -->
<form action="proses_login.php" method="post">
<div class="form-group">
<label>Username</label>
<input type="text" name="username" placeholder="Masukkan username" required>
</div>
<div class="form-group">
<label>Password</label>
<input type="password" name="password" placeholder="Masukkan password" required>
</div>
<button type="submit" class="btn-login">Masuk</button>
</form>
<div class="footer-text">
© 2026 SMK Digital
</div>
</div>
</body>
</html>
2. tambahkan kolom username dan password pada tabel pendaftar dengan perintah sql :
ALTER TABLE pendaftar
ADD username VARCHAR(50) NOT NULL,
ADD password VARCHAR(255) NOT NULL;
Tidak ada komentar:
Posting Komentar