<?php
session_start();
$login = $_POST['email'];
$password = md5($_POST['password']);

require "/home/desenvwor/public_html/videos/config/config.php";
$conecta = new mysqli(BD_HOST,BD_USUARIO,BD_SENHA,BD_BANCO);

$sql1 = $conecta->query("SELECT * FROM usuariosLeitura WHERE senha = '$password' AND email = '$login' AND aprovado = '1'");
while ($consulta1 = $sql1->fetch_assoc())
{$nome = $consulta1['nome'];}

if(mysqli_num_rows ($sql1) > 0)
{
$_SESSION['login'] = $login;
$_SESSION['password'] = $password;
$_SESSION['nome'] = $nome;
header('location:'.URL_BASE.'galeriaVideos');
}
else
{
unset ($_SESSION['login']);
unset ($_SESSION['password']);
unset ($_SESSION['nome']);
header('location:'.URL_BASE.'login/nLogin');
}

?>