Skip to content

Instantly share code, notes, and snippets.

@naaando
Created May 10, 2021 16:04
Show Gist options
  • Save naaando/7f1d7d0c7691bfa9249faf112f79107f to your computer and use it in GitHub Desktop.
Save naaando/7f1d7d0c7691bfa9249faf112f79107f to your computer and use it in GitHub Desktop.
<?php
session_start();
require_once 'Classes/Conexao.php';
$bd = new Conexao();
if (isset($_POST['cadastrar'])) {
$email = filter_input(INPUT_POST,'email',FILTER_SANITIZE_STRING);
$senha = filter_input(INPUT_POST,'telefone',FILTER_SANITIZE_STRING);
if (!empty($nome) && !empty($senha) ) {
if (var_dump($bd->logarUsuario($email,$senha))) {
header('Location:sistema.php');
exit;
} else {
$_SESSION['msg'] = ['messagem'=>'Email e senha incorrectos','type'=>'danger'];
header('Location:index.php');
exit;
}
} else {
$_SESSION['msg'] = ['messagem'=>'prencha todos os campos por favor','type'=>'danger'];
header('Location:index.php');
exit;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment