Advertisement
Guest User

expiraçao de sessao

a guest
Aug 23rd, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.72 KB | None | 0 0
  1. if(isset($_POST['user']) && isset($_POST['pass'])){
  2.     //session_start();
  3.     $login = $_POST['user'];
  4.     $pass = $_POST['pass'];
  5.    
  6.     $host = "localhost";
  7.     $bd = "mydb";
  8.     $user = "root";
  9.     $senha = "";
  10.        
  11.     $conexao = mysqli_connect($host,$user,$senha,$bd);
  12.  
  13.        
  14.     $sqls = "select * from usuarios where login='$login' and senha='$pass'";
  15.     $resultado = mysqli_query($conexao,$sqls);
  16.        
  17.     if(mysqli_num_rows($resultado)>0){
  18.         $_SESSION['login'] = $login;
  19.         $_SESSION['senha'] = $senhaf;          
  20.         $_SESSION["sessiontime"] = time() + 60;
  21.        
  22.         header('location:http://localhost/proj_cynthia/index.php');
  23.        
  24.        
  25.         } else {
  26.             echo "<script>alert(\"Login Invalido ou Senha Invalidos\");</script>";
  27.         }
  28.     mysqli_close($conexao);
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement