<?php
include "koneksi.php";
$username=$_POST['username'];
$password=md5($_POST['password']);


$qry=mysqli_query($con, "SELECT * FROM admin WHERE username='$username' AND password ='$password'");
$jumpa=mysqli_num_rows($qry);
$r=mysqli_fetch_array($qry);

if ($jumpa > 0) {
	session_start();
	$_SESSION[username]= $r[username];
	$_SESSION[password]= $r[password];
	header('location:home.php');
}
else {
	echo '<script language="javascript">
	alert("Email atau Password Yang anda Masukkan Salah atau Acount Sudah Diblokir");
	window.location="login.php";
	</script>';
	exit();
}
?>