Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- include_once("conecta.php");
- $pass=$_POST['pass'];
- $user=$_POST['user'];
- $sql = "SELECT usuario,senha FROM user";
- $resultado = mysql_query($sql);
- $linha = mysql_fetch_assoc($resultado);
- if ($linha)
- {
- while ($linha)
- {
- if (($linha[senha]==md5($pass)) AND ($linha[usuario]==$user))
- {
- $_SESSION['cod']=$linha[cod];
- $_SESSION['usuario']=$user;
- $_SESSION['senha']=$pass;
- header("Location: perfil.php?cont=$_SESSION['cod']");
- $linha = mysql_fetch_assoc($sql);
- }
- else
- {
- $linha = mysql_fetch_assoc($sql);
- echo ".";
- }
- }
- }
- else
- {
- echo "Nome de usu�rio ou senha inv�lidos!";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement