Quantcast
Channel: Últimos conteúdos
Viewing all articles
Browse latest Browse all 14190

Sistema de loguin function loginsuccessfully()

$
0
0

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>

Viewing all articles
Browse latest Browse all 14190

Trending Articles