Hacelo asi mejor:
Código PHP:
<?php
include( "conex/conect.php");
$link=Conectarse();
$usuario =mysql_real_escape_string(trim($_POST['usuario']));
$pass=md5(trim($_POST["txtpass"]));
if(!empty($usuario) && !empty($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);
?>