Ver Mensaje Individual
  #1 (permalink)  
Antiguo 26/07/2012, 15:10
LordofDestruction
 
Fecha de Ingreso: junio-2012
Mensajes: 17
Antigüedad: 11 años, 9 meses
Puntos: 0
Problemas de inicio de sesión con php

Espero alguien me pueda ayudar:
Tengo el siguiente código:
<?php
include('conexion.php');

$sql = "SELECT * FROM tbl_user";
$result = mysql_query( $sql);

while ( $row = mysql_fetch_array($result) ) {
if( $row['nick_usuario'] == $_POST['nick'] ){
$band = 1;
if( $row['pass_usuario'] == $_POST['pass'] ){
$band = 2;
endwhile;
}
endwhile;
}
$band = 0;
}

switch( $band ){
case 1:
printf("La contraseña es incorrecta");
break;

case 2:
$_SESSION['admin'] = $_POST['nick'];
$_SESSION['autenticado'] = "si";
break;

case 0:
printf("El usuario no existe en la base de datos");
break;
}
?>
Y me arroja error donde lo dejé en rojo.
:(