Ver Mensaje Individual
  #19 (permalink)  
Antiguo 18/10/2013, 15:58
Avatar de zreep
zreep
 
Fecha de Ingreso: octubre-2009
Ubicación: Argentina
Mensajes: 534
Antigüedad: 15 años, 4 meses
Puntos: 12
Respuesta: PDO y la seguridad

aaaaaaaaaaaaaaah, que boludo soy... y si me dices los mismo tienes razon, no me voy ofender.

Lo veo que parece facil, pero me esta constando mucho...

Código PHP:
session_start();

if(isset(
$_POST['enviar'])){
    if(!empty(
$_POST['user'])){
       
$stmt $con->prepare("SELECT * FROM usuario WHERE pass=:pass");
       
$stmt->execute(array(':pass'=>$_POST['user']));
       
$fila $stmt->fetch();       
            if(
$fila 0){
             
$_SESSION['logueado'] = "SI";
             
$_SESSION['usuario']  = $fila['nombre'];
            } else {
                echo 
"<div style='color: red; text-align: center;'>Usuario incorrecto</div>";
            }
    }

Asi?
__________________
Zreep