title: Php login not working
body: <p>So I've been trying to pull up something we did in class last night but I just can't figure it out somehow. It's not like a real login, I'm only trying to sort of compare the email and pass that the input gets with the ones stored in the database but I keep getting access denied.</p>
  
  <p>So this is the form:</p>
  
  <pre><code>&lt;form id="login_form" method="POST" action="index.php?pagina=login"&gt;
  
                                  &lt;input title="Ingrese su email" id="login_email" class="_click_clean _round" type="text" name="email" value="Email ..." /&gt;
                                  &lt;input title="Ingrese su clave" id="login_pass"  class="_click_clean _round" type="password" name="pass" value="" /&gt;
                                  &lt;input class="boton_login _round" id="login_submit" type="submit" value="Ingresar" /&gt;
  
                              &lt;/form&gt;
  </code></pre>
  
  <p>This is what I have in my login.php:</p>
  
  <pre><code>&lt;?php $resultado=login($_POST["email"], $_POST["pass"]);?&gt;
  
      &lt;div id="cuerpo" style="height:auto;"&gt;
  
  
  
          &lt;div id="izquierda"&gt;
                  &lt;?php
              require "templates/menues/menu.php";
              ?&gt;
          &lt;/div&gt;
  
          &lt;div id="principal"&gt;
                          &lt;?php 
  
                          $pass=SHA1($_POST["pass"]);
                          if ($resultado["email"]==$_POST["email"] &amp;&amp; $resultado["pass"]==$pass){
  
                          echo "&lt;h1&gt;Login Exsitoso!&lt;/h1&gt;";
                          echo "&lt;p&gt;bienvenido&lt;/p&gt;". $resultado["email"];
                          }
                           echo "acceso denegado";
  
                                  ?&gt;
  
          &lt;/div&gt;
  
      &lt;/div&gt;
  </code></pre>
  
  <p>This is the function i'm using:</p>
  
  <pre><code>  &lt;?php
  
  function login($email, $pass){
  $pass=  sha1($pass);
  $sql="SELECT FROM usuarios email, pass WHERE email='$email' and pass='$pass'";
  $resultado= query($sql);
  
  if(!sizeof($resultado)){
      return FALSE;
   }
   return $resultado[0];
  }
  
  ?&gt;
  </code></pre>
  
  <p>and this is what I have in a db.inc.php file:</p>
  
  <pre><code>function bufferedQuery($sql){
  $resultado= query($sql);
  $datos= Array();
  while($fila= mysqli_fetch_assoc($resultado)){
      $datos[]=$fila;
  }
  return $datos;
  }
  </code></pre>
  
  <p>all I keep getting is "acceso denegado" which is what I told it to say in case the email and pass didn't match with db. Hope you can help, thanks!</p>