Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(isset($_POST['user']) && isset($_POST['pass'])){
- //session_start();
- $login = $_POST['user'];
- $pass = $_POST['pass'];
- $host = "localhost";
- $bd = "mydb";
- $user = "root";
- $senha = "";
- $conexao = mysqli_connect($host,$user,$senha,$bd);
- $sqls = "select * from usuarios where login='$login' and senha='$pass'";
- $resultado = mysqli_query($conexao,$sqls);
- if(mysqli_num_rows($resultado)>0){
- $_SESSION['login'] = $login;
- $_SESSION['senha'] = $senhaf;
- $_SESSION["sessiontime"] = time() + 60;
- header('location:http://localhost/proj_cynthia/index.php');
- } else {
- echo "<script>alert(\"Login Invalido ou Senha Invalidos\");</script>";
- }
- mysqli_close($conexao);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement