-
Notifications
You must be signed in to change notification settings - Fork 0
/
testeLogin.php
43 lines (35 loc) · 1.03 KB
/
testeLogin.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
session_start();
// print_r($_REQUEST);
if(isset($_POST['submit']) && !empty($_POST['email']) && !empty($_POST['senha']))
{
// Acessa
include_once('config.php');
$email = $_POST['email'];
$senha = $_POST['senha'];
print_r('Email: ' . $email);
print_r('<br>');
print_r('Senha: ' . $senha);
$sql = "SELECT * FROM cadastro WHERE email = '$email' and senha = '$senha'";
$result = $conexao->query($sql);
// print_r($sql);
// print_r($result);
if(mysqli_num_rows($result) < 1)
{
unset($_SESSION['email']);
unset($_SESSION['senha']);
header('Location: login.php');
}
else
{
$_SESSION['email'] = $email;
$_SESSION['senha'] = $senha;
header('Location: sistema.php');
}
}
else
{
// Não acessa
header('Location: login.php');
}
?>