Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require 'imports.php';
- require 'lib/db.php';
- if (isset($_POST['btnenviar'])) {
- $email = $_POST['email'];
- $senha = $_POST['pass'];
- $query = mysqli_query($con, "SELECT * FROM users WHERE email = '$email'");
- if (mysqli_num_rows($query) > 0) {
- $arr = mysqli_fetch_array($query);
- if ($senha == $arr['senha']) {
- setcookie("hash", $arr['hash']);
- header('location: pages/home.php');
- }else{
- $error = "Senha incorreta";
- }
- }else{
- $error = "Email incorreto";
- }
- }
- <?php
- unset($_COOKIE['hash']);
- if (isset($_COOKIE['hash'])) {
- }else{
- header('location: ../');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement