Ver Mensaje Individual
  #4 (permalink)  
Antiguo 09/09/2008, 13:12
sravinovich
 
Fecha de Ingreso: febrero-2008
Mensajes: 8
Antigüedad: 16 años, 3 meses
Puntos: 0
Respuesta: diferenciar administrador de usuario????

a mi no me sirveeee

if(($_POST['txtUsuario'] == "s") && ($_POST['txtPass']=="s"))
{
$algo=1;
}
$sql="select * from `usuario` where nick='".$_POST["txtUsuario"]."' AND psw='".$_POST['txtPass'] ."'";

$result=mysql_query($sql,$link);
$datos=mysql_fetch_array($result);
echo $datos["Tipo"];
if(($result)==1 || $algo==1)
{

if(($datos['Tipo']=='Administrador') || ($algo==1))
{
die ("<script>document.location='index-3B.php';</script>"); /// Administrador
}
else
{
echo "<script>window.location='Donde.html';</script>"; ///// Usuario
}
$algo=0; //
}
else
{
echo "<script> alert('Login incorrecto'); </script>";
}
}




SIEMPRE ME ENVIA LOGIN INCORRECTO..IMPRIMO EL CONTENIDO DEL ARREGLO $DATOS Y ME SALE ADMINISTRADOR O USUARIO DEPENDIENDO DE LOS DATOS Q META.. Y NO ME SIRVE EL IF :s AYUDA PLXX