Halaman login diberi nama index.php
-------------------------------------
<html>
<head>
<title>Silahkan Login</title>
<link href="css/main.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<script type="text/javascript">
function peringatan(){
alert("Selamat Datang");
}
</script>
<div class="container">
<div class="badan">
<div class="kepala">
<p class="kepalatext">» Login «</p>
</div>
<form class="bingkai" action="proseslogin.php" method="POST">
<div>
<input class="email" type="text" name="username" placeholder="Masukkan Username"/>
<input class="passwd" type="password" name="password" placeholder="Masukkan Pasword"/>
</div>
<div class="bawah">
<input class="daftar" type="submit" name="submit" value="» Login «">
<p class="footertext">© 2016 <a href="http://lkpsctc.wordpress.com">www.lkpsctc.wordpress.com</a></p>
</div>
</form>
</div>
</div>
</div>
</div>
</body>
</html>
----------------------
memberikan file css
buat file dengan nama main.css
.container{
position: absolute;margin-top: -200px;margin-left: -200px;left: 50%;top: 50%;width: 400px;height: 220px;
}
.bingkai{
border: 5px solid #3498db;
width: 440px;
height: 300px;
}
body{
background-color: #bdc3c7;
}
.kepala{
width: 450px;
height: 50px;
background-color: #3498db;
border-radius: 3px 3px 0 0;
}
.kepalatext{
color: #ffffff;
text-align: center;
font-size: 18pt;
font-family: Century;
padding-top: 12px;
}
.kepalatext:hover{
color: #e74c3c;
}
.badan{
width: 450px;
height: 360px;
background-color: #ffffff;
border-radius: 3px;
box-shadow: 6px 6px 0 0 #ffffff;
}
.email{
font-family: Century;
font-size: 13pt;
width: 415px;
height: 35px;
border: 1px solid #2980b9;
margin-left: 15px;
margin-top: 65px;
padding-left: 5px;
display: compact;
box-shadow: #95a5a6;
border-radius: 5px;
}
.passwd{
font-family: Century;
font-size: 13pt;
width: 415px;
height: 35px;
border: 1px solid #2980b9;
margin-left: 15px;
margin-top: 10px;
padding-left: 5px;
display: compact;
box-shadow: #95a5a6;
border-radius: 5px;
}
.daftar{
background-color: #ffffff;
color: #3498db;
margin-top: 1px;
margin-left: 15px;
width: 415px;
height: 40px;
border: 2px solid #3498db;
border-radius: 5px;
font-family: Century;
font-size: 13pt;
}
.daftar:hover{
background-color: #e74c3c;
color: #ffffff;
}
.bawah{
margin-top: 80px;
width: 440px;
height: 80px;
background-color: #3498db;
border-radius: 0 0 3px 3px;
}
.footertext{
margin-top: 5px;
text-align: center;
font-family: Century;
font-size: 12pt;
color: #ffffff;
}
.footertext>a{
color: #fefefe;
}
.footertext>a:hover{
color: #0e0e0e;
}
-------------------------
buat file proseslogin.php
-----------------------
<?php
include "conn.php";
$username = $_POST['username'];
$pass = $_POST['password'];
$login = mysqli_query($dbconnect, "SELECT * FROM user WHERE username = '$username' AND password='$pass'");
$row=mysqli_fetch_array($login);
if ($row['username'] == $username AND $row['password'] == $pass)
{
session_start();
$_SESSION['username'] = $row['username'];
$_SESSION['password'] = $row['password'];
header('location:haldepan.php');
}
else
{
echo "<center><br><br><br><br><br><br><b>LOGIN GAGAL! </b><br>
Username atau Password Anda tidak benar.<br>";
echo "<br>";
echo "<input class='btn btn-blue' type=button value='ULANGI LAGI' onclick=location.href='index.php'></a></center>";
}
?>
-------------------------
Hayyy guys...
BalasHapussedang bosan di rumah tanpa ada yang bisa di kerjakan
dari pada bosan hanya duduk sambil nonton tv sebaiknya segera bergabung dengan kami
di D*E*W*A*P*K agen judi terpercaya di add ya Whatshapp : +85587781422 di tunggu lo ^^