Ver Mensaje Individual
  #16 (permalink)  
Antiguo 04/02/2010, 12:02
ahome8990
 
Fecha de Ingreso: enero-2010
Mensajes: 39
Antigüedad: 14 años, 3 meses
Puntos: 0
Respuesta: problemas con login

ya corregí el error de los headers y ya me funciona bien pero ahora si coloco un usuario existente siempre me manda que no existe este es el código:
Código PHP:
<?php
    
include( "conex/conect.php"); 
    
$link=Conectarse();
    
$usuario =mysql_real_escape_string($_POST['usuario']);
    
$pass=md5($_POST["txtpass"]);
    if(
trim($usuario)!= "" && trim($pass)!= ""){
    
$sql="SELECT * FROM 'empresa' where usuario = '$usuario' and pass= '$pass'";
    
$rs mysql_query($sql,$link);
    if(
$row mysql_fetch_array($rs)){
    if(
$row['usuario']==$usuario){    
            if(
$row['pass']==$pass){
                
$_SESSION['user']='si';
                
$_SESSION["usuario"]=$row["usuario"];
                
header("Location:/admin/index.php");
                echo 
$usuario
    }else{
header("Location:index.php?msg='1'");}
    }else{
header("Location:index.php?msg='2'");}
    }else{
header("Location:index.php?msg='3'");}
    }else{
header("Location:index.php?msg='4'");}    
    
mysql_close($link);
?>