Este es el código:
comprueba.php
Código PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>Comprueba</title>
<meta http-equiv="content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<?php
session_start();
include('config.php');
require_once("./include/class.inputfilter.php");
$ifilter = new InputFilter();
$correo=$ifilter->process($_POST['correo']);
$password=$ifilter->process($_POST['password']);
$conexion=conectar();
if(!empty($correo) && !empty($password))
{
$comprobacion = mysql_query("SELECT correo, password FROM registrados WHERE correo='".mysql_real_escape_string($correo)."' AND password='".mysql_real_escape_string($password)."'",$conexion) or die ("Query Fallo".mysql_error());
if(mysql_num_rows($comprobacion) == 1) {
$_SESSION['correo']=$correo;
$_SESSION['password']=$password;
header('location: miperfil.php');
}
else {
echo "Error de Usuario Y/o Contraseña";
}
}
?>
</body>
</html>