<?php

session_start();


if (isset($_POST['login']) && isset($_POST['senha'])) {
    include '../conexao.inc.php';

    $login = $_POST['login'];
    $senha = $_POST['senha'];



    $sql = "select * from inscricoes"
            . " where inscricao = '$login' and email = '$senha' ";

    $res = mysqli_query($conexao, $sql) or die('Erro na query: <BR>' . $sql . '<BR>' . mysqli_error());
    $row = mysqli_fetch_array($res);
$i=0;
    if (mysqli_num_rows($res) > 0) {
        
        $_SESSION["nome"] = $row["nome"];

        $_SESSION["id"] = $row["id"];
        $_SESSION["inscricao"] = $login;
        $_SESSION["insc"]=$row["inscricao"];
        echo true;
        } else {
        echo false;
    };
};
?>