ruben718

Conexao

Jul 20th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.50 KB | None | 0 0
  1. <?php
  2.   include 'server/db.php';
  3.  
  4.   session_start();
  5.  
  6.   $login = $_POST['login'];
  7.   $senha = $_POST['senha'];
  8.  
  9.   $resultado = mysqli_query($conexacao, "SELECT `nome`, `pass` FROM `admins` WHERE `nome` = '$login' and `pass` = '$senha'");
  10.  
  11.   if(mysqli_num_rows ($resultado) > 0 ){
  12.     $_SESSION['login'] = $login;
  13.     $_SESSION['senha'] = $senha;
  14.     header('location:sistema.php');
  15.   } else {
  16.       unset ($_SESSION['login']);
  17.       unset ($_SESSION['senha']);
  18.       header('location:index.php');
  19.   }
  20. ?>
Add Comment
Please, Sign In to add comment