index
<?php
require_once'CLASSES/usuario.php';
$u = new usuario;
?>
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="utf-8"/>
<title>Lava jato LG</title>
<link rel="stylesheet" type="text/css" href="CSS/style.css">
<head>
</head>
<body>
<div id="corpo-form">
<h1>Entrar</h1>
<form method="POST">
<input type="email" placeholder="Usuário" name="email">
<input type="password" placeholder="Senha" name="senha">
<input type="submit" value="Entrar">
<a href="cadastrar.php">Ainda náo é inscrito?<strong> Cadastre-se </strong> </a>
</form>
</div>
<?php
if(isset($_POST['email']))
{
$email = addslashes($_POST['email']);
$senha = addslashes($_POST['senha']);
}
if(!empty($email)&& !empty($senha))
{
$u->conectar("login", "localhost", "root", "");
if ($u->msgERRO =="")
{
if($u->logar($email,$senha))
{
header("location:areaPrivada.php");
}
else
{
echo "Email e/ou senha estão incorretor!!";
}
}
else
{
echo "ERRO: ".$u->msgERRO;
}
}
?>
</body>
</html>