<?php

include "main.php";

$email = AntiInjectionSQL($_REQUEST['email']);
$password = AntiInjectionSQL($_REQUEST['password']);

$SQL = "SELECT COUNT(*) FROM admin WHERE email = '$email' AND password = '$password'";
$reponse = $pdo->query($SQL);
$req = $reponse->fetch();

if($req[0] == 0)
{
	header("Location: index.php?error=1");
	exit;
}
else
{
	$_SESSION['email'] = $email;
	$_SESSION['password'] = $password;
	
	header("Location: home.php");
	exit;
}

?>