<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
</head>
<body>
</h2>
<h1><a href="keluar.php">Logout</a></h1>
</body>
</html>
session_start();
include "db.php"; //inlcude akan mengambil seluruh isi dari dokumen db.php
//kita tampung name dari inputan yakni username dan password
$user=$_POST['username'];
$pas=md5($_POST['password']);
//lakukan pengambilan data dari database
//$melon=mysqli_query($dbs,"select * from admin where username='$user' and
password='$pas'");
//if(mysqli_num_rows($melon)==1){
if($user=="kucing" and $pas="meong"){
$_SESSION['user']=$user;
header("location:index.php");
}else{//jika username dan password salah
header("location:loginForm.php?error=1");
}
?>