Ir para conteúdo

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Melh3

Sistema de loguin function loginsuccessfully()

Recommended Posts

Galera eu fiz uma página de autenticação, mas não sou redirecionado à página restrita e nem aparece uma mensagem.

Quando eu digito o loguin errado, ele funciona corretamente, enviado para a pagina de loguin.

Nao sei o que esta dando

 

Codigo da pagina de autenticaçao:

 

<?php require_once('Connections/conexao.php'); ?>
<!DOCTYPE html>
<link href="http://fonts.googleapis.com/css?family=Muli:300" rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=Roboto" rel="stylesheet" type="text/css">
<link href="small.css" rel="stylesheet" media="screen and (min-width:0px)" type="text/css">
<link href="medium.css" rel="stylesheet" media="screen and (min-width:1000px)" type="text/css">
<link href="large.css" rel="stylesheet" media="screen and (min-width:1350px)" type="text/css">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Autenticando ...</title>
<script type="text/javascript">
function loginsuccessfully() {
setTimeout("window.location='minhaconta/index.php'", 450);
}
function loginfailed() {
setTimeout("window.location='loguin_erro.php'", 450);
}
</script>
</head>
<body>
<?php
$login=$_POST['login'];
$senha=$_POST['senha'];
$sql = mysql_query("SELECT * FROM es_alunos WHERE login = '$login' and senha = '$senha'") or die (mysql_error());
$row = mysql_num_rows($sql);
if($row > 0) {
sesion_start();
$_SESSION["login"]=$_POST["login"];
$_SESSION["senha"]=$_POST["senha"];
echo "<script>loginsuccessfully()</script>";
echo "<center>Verificando aluno...</center>"; /* LOGUIN FEITO */
}
else{
echo "<center>Verificando aluno...</center>"; /* LOGUIN ERRO */
echo "<script>loginfailed()</script>";
}
?>
</body>
</html>
<style>
body{
padding-top:15%;
}
</style>

Compartilhar este post


Link para o post
Compartilhar em outros sites

 

Galera eu fiz uma página de autenticação, mas não sou redirecionado à página restrita e nem aparece uma mensagem.

Quando eu digito o loguin errado, ele funciona corretamente, enviado para a pagina de loguin.

Nao sei o que esta dando

 

Codigo da pagina de autenticaçao:

 

<?php require_once('Connections/conexao.php'); ?>
<!DOCTYPE html>
<link href="http://fonts.googleapis.com/css?family=Muli:300" rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=Roboto" rel="stylesheet" type="text/css">
<link href="small.css" rel="stylesheet" media="screen and (min-width:0px)" type="text/css">
<link href="medium.css" rel="stylesheet" media="screen and (min-width:1000px)" type="text/css">
<link href="large.css" rel="stylesheet" media="screen and (min-width:1350px)" type="text/css">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Autenticando ...</title>
<script type="text/javascript">
function loginsuccessfully() {
setTimeout("window.location='minhaconta/index.php'", 450);
}
function loginfailed() {
setTimeout("window.location='loguin_erro.php'", 450);
}
</script>
</head>
<body>
<?php
$login=$_POST['login'];
$senha=$_POST['senha'];
$sql = mysql_query("SELECT * FROM es_alunos WHERE login = '$login' and senha = '$senha'") or die (mysql_error());
$row = mysql_num_rows($sql);
if($row > 0) {
sesion_start();
$_SESSION["login"]=$_POST["login"];
$_SESSION["senha"]=$_POST["senha"];
echo "<script>loginsuccessfully()</script>";
echo "<center>Verificando aluno...</center>"; /* LOGUIN FEITO */
}
else{
echo "<center>Verificando aluno...</center>"; /* LOGUIN ERRO */
echo "<script>loginfailed()</script>";
}
?>
</body>
</html>
<style>
body{
padding-top:15%;
}
</style>
<?php require_once('Connections/conexao.php'); ?>
<!DOCTYPE html>
<link href="http://fonts.googlea...family=Muli:300" rel="stylesheet" type="text/css">
<link href="http://fonts.googlea...s?family=Roboto" rel="stylesheet" type="text/css">
<link href="small.css" rel="stylesheet" media="screen and (min-width:0px)" type="text/css">
<link href="medium.css" rel="stylesheet" media="screen and (min-width:1000px)" type="text/css">
<link href="large.css" rel="stylesheet" media="screen and (min-width:1350px)" type="text/css">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Autenticando ...</title>
    <script type="text/javascript">
        function loginsuccessfully() {
            setTimeout("window.location='minhaconta/index.php'", 450);
        }
        function loginfailed() {
            setTimeout("window.location='loguin_erro.php'", 450);
        }
    </script>
</head>

<body>
    <?php
    if (isset($_POST['login']) and isset($_POST['login'])) {//verificar primeiro se existe o post
        $login = $_POST['login'];
        $senha = $_POST['senha'];
        $sql = mysql_query("SELECT * FROM es_alunos WHERE login = '$login' and senha = '$senha'") or die(mysql_error());
        $row = mysql_num_rows($sql);
        if ($row > 0) {
            //sesion_start(); //ta errado
            session_start();//correto
            $_SESSION["login"] = $_POST["login"];
            $_SESSION["senha"] = $_POST["senha"];
            echo "<script>loginsuccessfully()</script>";
            echo "<center>Verificando aluno...</center>"; /* LOGUIN FEITO */
        } else {
            echo "<center>Verificando aluno...</center>"; /* LOGUIN ERRO */
            echo "<script>loginfailed()</script>";
        }
    }
    ?>
</body>
</html>
<style>
    body{
        padding-top:15%;
    }
</style>

vc não usa nenhum tipo de criptografia na senha?

Compartilhar este post


Link para o post
Compartilhar em outros sites

nao

 

 

<?php require_once('Connections/conexao.php'); ?><!DOCTYPE html><link href="http://fonts.googlea...family=Muli:300" rel="stylesheet" type="text/css"><link href="http://fonts.googlea...s?family=Roboto" rel="stylesheet" type="text/css"><link href="small.css" rel="stylesheet" media="screen and (min-width:0px)" type="text/css"><link href="medium.css" rel="stylesheet" media="screen and (min-width:1000px)" type="text/css"><link href="large.css" rel="stylesheet" media="screen and (min-width:1350px)" type="text/css"><head>    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />    <title>Autenticando ...</title>    <script type="text/javascript">        function loginsuccessfully() {            setTimeout("window.location='minhaconta/index.php'", 450);        }        function loginfailed() {            setTimeout("window.location='loguin_erro.php'", 450);        }    </script></head><body>    <?php    if (isset($_POST['login']) and isset($_POST['login'])) {//verificar primeiro se existe o post        $login = $_POST['login'];        $senha = $_POST['senha'];        $sql = mysql_query("SELECT * FROM es_alunos WHERE login = '$login' and senha = '$senha'") or die(mysql_error());        $row = mysql_num_rows($sql);        if ($row > 0) {            //sesion_start(); //ta errado            session_start();//correto            $_SESSION["login"] = $_POST["login"];            $_SESSION["senha"] = $_POST["senha"];            echo "<script>loginsuccessfully()</script>";            echo "<center>Verificando aluno...</center>"; /* LOGUIN FEITO */        } else {            echo "<center>Verificando aluno...</center>"; /* LOGUIN ERRO */            echo "<script>loginfailed()</script>";        }    }    ?></body></html><style>    body{        padding-top:15%;    }</style>

você não usa nenhum tipo de criptografia na senha?

nao

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.