El codigo del comprueba.php es el siguiente:
Código PHP:
<?php
session_start();
include("../reg/config.php");
$login = $_POST['login'];
$pass = $_POST['pass'];
$query=mysql_query("SELECT * FROM usu WHERE email='$login'") or die(mysql_error());;
if(mysql_num_rows($query)==0){
header("location: index.php?error=3");
exit;
} else {
$array=mysql_fetch_array($query);
$password = sha1("CoriaWeb");
if($array["pass"]!=$password){
header("Location: index.php?error=7");
exit;
$_SESSION["login"]=$login;
$_SESSION["pass"]=$pass;
$_SESSION["id"] = $array['id'];
session_register();
header("Location: index.php");
exit;
}
}
?>