Foros del Web » Programando para Internet » PHP »

Zona restringida

Estas en el tema de Zona restringida en el foro de PHP en Foros del Web. HOLA, TENGO LA SIGUIENTE CUESTION. TENGO UN PAGINA DIVIDA EN 3 FRAMES, EL DE LOS MENUS, LA CABEZERA Y EL FRAME CENTRAL. PREVIAMENTE AY UNA ...
  #1 (permalink)  
Antiguo 28/01/2010, 14:07
 
Fecha de Ingreso: enero-2010
Mensajes: 3
Antigüedad: 14 años, 2 meses
Puntos: 0
Zona restringida

HOLA, TENGO LA SIGUIENTE CUESTION.

TENGO UN PAGINA DIVIDA EN 3 FRAMES, EL DE LOS MENUS, LA CABEZERA Y EL FRAME CENTRAL.

PREVIAMENTE AY UNA PAGINA DE LOGIN PARA ACCEDER A ESTA PAGINA

UNA VEZ QUE ACCESA LE MUESTRA LAS 3 PANTALLAS EN EL MENU TENGO 3 MENUS Y TENGO EL "ROL" DE LA PERSONA QUE SE LOGEO

EJEMPLO:

MENU1
MENU2
MENU3

ROL ADMINSTRADOR

AQUI ES DONDE VIENE MI PREGUNTA:

TENGO 3 ROLES DE USUARIO Y ME GUSTARIA QUE AL HACER CLICK SOBRE EL MENU ME DISTINGA SI YO TENGO ACCESO A ESE MENU EN CASO DE SER VERDADERO QUE ME HABRA EN EL FRAME CENTRAL LA PAGINA REQUERIDA Y EN CASO DE QUE NO ME MUESTRE UN PANTALLA EN ROJO EN EL FRAME CENTRAL DONDE ME DIGA QUE NO TIENE DERECHO A ESTE MENU.

SEGUN SE CON UN SCRIPT SE PUEDE HACER PERO NO HE PODIDO.

SI ALGUIEN TIENE ALGUNA IDEA O ME PODRIA AYUDAR SERIA MUY AGRADECIDO.

AQUI DEJO EL CODIGO FUENTE DE LA PANTALLA DE LOS MENUS

<?php
session_start();
$usuario = $_SESSION['k_USUARIO'];
?>

<html>

<head>

<title>Menu</title>

<base target="_self">

<table border="0" width="100%" align="center">
<tr>
<td align="center"><img src="imagenes/logo_uv.gif" width="120" height="138" border="0"></td>
</tr>
</table>

<center>

</head>

<body style="font-family: Verdana; font-size: 12pt;" bgcolor="#77BADB">

<?php

include("conexion3.php");
$sql="SELECT * FROM usuarios WHERE usuario = '$usuario'";
$resultado = mysql_query($sql);

$roll=$row["rol"];
$op1="COORDINADORA";
$op2="ALUMNO";
$op3="TUTOR";

function Redireccionar(){
if($roll==$op1){
echo'<a href="opciones1.php" target="mainFrame">';
}else{
echo'<a href="rojo.php" target="mainFrame">';
}
}

if (!$resultado) {
echo "No pudo ejecutarse satisfactoriamente la consulta ($sql) " .
"en la BD: " . mysql_error();
exit;
}

if (mysql_num_rows($resultado) == 0) {
echo "No se han encontrado filas, nada a imprimir, asi que voy " .
"a detenerme.";
exit;
}
?>

<div align="center">

<table border="0" width="150">

<tr>
<td>&nbsp;</td>
</tr>

<tr>
<td>&nbsp;</td>
</tr>

<tr>
<td align="center"><b><font color="white" face="Trebuchet MS" size="3">
<a target="mainFrame" href="content.php">
<span style="text-decoration: none"><font color="#000000">Inicio</font></span></a></font></b></td></tr>
<a target="mainframe" href="rojo.php">
<tr>
<td>&nbsp;</td>
</tr>

<tr>
<td align="center"><b><a href="#" target="mainFrame">
<font color="#FFFFFF" face="Trebuchet MS" size="3">
<span style="text-decoration: none">Coordinadoras</span></a></b></td></tr>

<tr>
<td>&nbsp;</td>
</tr>

<tr>
<td align="center"><b><a href="opciones2.php" target="mainFrame">
<font color="#000000" face="Trebuchet MS" size="3">
<span style="text-decoration: none">Alumnos</span></a></b></td></tr>

<tr>
<td>&nbsp;</td>
</tr>

<tr>
<td align="center"><b><a href="opciones3.php" target="mainFrame">
<font color="#FFFFFF" face="Trebuchet MS" size="3">
<span style="text-decoration: none">Tutores</span></a></b></td></tr>

<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>

<?php
while ($fila = mysql_fetch_assoc($resultado)) {
?>

<tr>
<td align="center"><b>
<p><font face="Trebuchet MS" size="3" color="white">Roll&nbsp;</font>
<font face="Trebuchet MS" size="3" color="black"><?php
echo $fila["rol"];
?></b></p></td></tr>
<?php
}
mysql_free_result($resultado);
?>

</tbody>
</table>

</div>

</body>

</html>
  #2 (permalink)  
Antiguo 28/01/2010, 14:31
Avatar de dquispe  
Fecha de Ingreso: mayo-2009
Ubicación: Lima
Mensajes: 232
Antigüedad: 14 años, 11 meses
Puntos: 0
Respuesta: Zona restringida

Pues tio te dire que estamos en las mimas, al igual que tu estoy desarrollando una administración de usuarios pero la mia son con puros check estoy que lo desarrollo, te recomiendo que trabajes con sesiones.

Etiquetas: restringida, zonas
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 21:01.