Ver Mensaje Individual
  #2 (permalink)  
Antiguo 15/04/2004, 20:36
Avatar de drcyber
drcyber
 
Fecha de Ingreso: julio-2002
Mensajes: 826
Antigüedad: 21 años, 8 meses
Puntos: 2
Me parece que ese IF es incorrecto; ahi estas diciendo esto:

SI $_POST["usuario"] es distinto a "miguel" Y $_POST["contrasena"] es distinto a "qwerty" entonces AUTENTIFICAR AL USUARIO.

Eso no tiene sentido hombre. Debería quedarte asi:

Código PHP:
if ($_POST["usuario"]=="miguel" && $_POST["contrasena"]=="qwerty"){
  
//usuario y contraseña válidos
  //habilita la salida del buffer
  
ob_start();
  
session_start();
  
session_name("autentificado");
  
$_SESSION['autentificado']= "SI";
  
header ("Location: aplicacion.php"); 
} else {
  
//si no existe le mando otra vez a la portada
  
header("Location: index.php?errorusuario=si");
}
//pones esto al final de tooooda tu página, lo cual deshabilita la salida del buffer
ob_end_flush(); 
Saludos.
__________________
Dr. Cyber
Ingeniarte.com
(soy el mismo Takitei)