Código PHP:
session_start();
include("../reg/config.php");
$login = $_POST['login'];
$pass = $_POST['pass'];
$qry="SELECT * FROM usu WHERE email='$login'";
//echo $qry."<br>";
$result=mysql_query($qry) or die(mysql_error());
//echo "Las filas encontradas son ".mysql_num_rows($result);
if(mysql_num_rows($result)==0){
header("location: index.php?error=3");
exit;
} else {
$array=mysql_fetch_array($result);
$password = sha1("CoriaWeb");
if($array["pass"]!=$password){
header("Location: index.php?error=7");
exit;
}else{
$_SESSION["login"]=$login;
$_SESSION["pass"]=$pass;
$_SESSION["id"] = $array['id'];
session_register();
header("Location: index.php");
exit;
}
}