![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
06/05/2009, 09:32
|
| | Fecha de Ingreso: mayo-2009
Mensajes: 13
Antigüedad: 15 años, 9 meses Puntos: 0 | |
ey gracias...jjejejeje
ya vi cual era el error
la consulta como te dije estaba bn
simplemente era el montaje del codigo
cambie los if y cree un switch con case's para los usuarios y asi funciono
gracias por tu ayuda y a harvestmoon
saludos programadores
moacho de nuevo yo...
q le paso al codigo q ya hoy no quiere funcionar y me sigue pasando el problema de los usuarios?????...
acaso sirve x dias????
aqui lo anexo a uds....
<?
$usuario = $_POST["usuario"];
$id = $_POST["password"];
mysql_connect("*********","********","******");
mysql_select_db ("******");
$ssql = "SELECT Usuario,contrasena FROM datos_usuario WHERE Usuario='$usuario' and contrasena='$id' ";
$rs = mysql_query($ssql);
//VERIFICA SI EL USUARIO Y CONTRASEÑA SON válidoS
if (@mysql_num_rows($rs)!=0)
{
$res = "SELECT Nombre,Apellido,Perfil FROM datos_usuario WHERE Usuario='$usuario' and contrasena='id'";
$query=mysql_query($res) or die('Consulta fallida: ' . mysql_error());
$row=mysql_fetch_array($query);
$perfil= $row['Perfil'];
session_start();
$_SESSION["Nombre"]=$row[0];
$_SESSION["Apellido"]=$row[1];
$_SESSION["Perfil"]=$row[2];
$_SESSION["autentificado"]="SI";
switch ($perfil)
{
case ($perfil=="perfil1" ):
echo "<script type=\"text/javascript\">alert('Autenticacion Existosa');
location.href='opciones_perfil1.php'; </script>";
break;
case ($perfil=="pefil2"):
echo "<script type=\"text/javascript\">alert('Autenticacion Existosa');
location.href='opciones_perfil2.php'; </script>";
break;
case ($perfil=="perfil3" || $perfil=="pefil3.1"):
echo "<script type=\"text/javascript\">alert('Autenticacion Existosa');
location.href='opciones_perfil3.php'; </script>";
break;
case ($perfil=="perfil4" || $perfil=="perfil4.1"):
echo "<script type=\"text/javascript\">alert('Autenticacion Existosa');
location.href='opciones_perfil.php'; </script>";
break;
case ($perfil=="perfil5");
echo "<script type=\"text/javascript\">alert('Autenticacion Existosa');
location.href='opciones_perfil5.php'; </script>";
break;
}
}
else
{
echo "<script type=\"text/javascript\">alert('Pa ' ver si funciono');
location.href='autentificacion.php'; </script>";
}
?>
les agradesco la ayuda q me presten
Última edición por GatorV; 07/05/2009 a las 12:24 |