Created
May 10, 2021 16:04
-
-
Save naaando/7f1d7d0c7691bfa9249faf112f79107f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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