Login System - HTTP ERROR 500

0

I am doing a login system, however when submitting the data it from HTTP ERROR 500. I tried changing the code anyway but this error continues. I'm using 000webhost to test how the site is getting, does this server that does not support the codes I've used or have something wrong with the code and am I not realizing?

<?php
session_start();
include_once("conecta.php");
if ((isset($_POST['email'])) && (isset($_POST['senha']))) {
    $email = mysqli_real_escape_string($conn, $_POST['email']);
    $senha = mysqli_real_escape_string($conn, $_POST['senha']);
    $senha - md5($senha);

    $sql = "SELECT * FROM voluntarios WHERE email = '$email' and senha = '$senha'";
    $result = mysqli_query($conn, $sql);
    $resultado = mysqli_fetch_assoc($result);

    if (empty($resultado)) {
        $_SESSION['loginErro'] = "E-mail e/ou senha inválidos!"
        header("Location: entrar.php");
    } elseif (!empty($resultado)) {
        header("Location: indexVol.php");
    } else{
        $_SESSION['loginErro'] = "E-mail e/ou senha inválidos!"
        header("Location: entrar.php");
    }



} else {
    $_SESSION['loginErro'] = "E-mail ou senha inválidos!";
    header("Location: entrar.php");
}
?>

Connecting to the database:

<?php
$conn=mysqli_connect("localhost", "arthur", "senha","banco");

if (!$conn) {
    die("Falha na conexão: " . mysql_connect_error());
} else {
    //echo "Conexão realizada com sucesso";
}
?>
    
asked by anonymous 26.09.2017 / 03:36

0 answers