Ver Mensaje Individual
  #1 (permalink)  
Antiguo 04/11/2004, 13:30
Avatar de JuanKa
JuanKa
 
Fecha de Ingreso: septiembre-2004
Mensajes: 468
Antigüedad: 19 años, 7 meses
Puntos: 1
Pasar variable de pag1 a pag2

Hola a todos tengo un problemilla que no llego a ubicar es para que los usuarios solo puedan entrar a las paginas logueandose caso contrario que regrese a l index.

Tengo una pagina de nombre seguirdad.php
<?php
include('config_admin.php');
//echo $_SESSION[usuario]; esta variable lo recojo muy bien
if(!isset($_SESSION[usuario]) ) //comprobamos que no existe la session, es decir, que no se ha logeado, y mostramos el form
{
include('cabecera.php');
echo "<table width='770' border='0' cellpadding='0' cellspacing='0' bgcolor='#E6E6E6' align='center'>";
echo "<tr>";
echo "<th>";
echo "<table width='500' border='2' align='center'>";
echo "<tr>";
echo "<th>";

echo "<center><strong><font color=\"#990000\" face=\"Verdana\">Zona Restringida. Acceso NO Permitido<br><META HTTP-EQUIV=Refresh CONTENT=\"4; URL= ../index.php\">\n</font></strong></center>";
echo "<br>"."<center><strong><font color=\"#0000ff\" face=\"Verdana\">Ira a la Pagina Principal... Espere unos segundos...</font></strong></center>";
echo "</th>";
echo "</tr>";
echo "</table>";
echo "</th>";
echo "</tr>";
echo "</table>";
include('pie_pagina.php');
}
else
{
$segur=nook;
}

?>

y en esta otra es para que entren como debe ser ...LOGUEANDOSE para esto hago que la variable definida en seguridad sea diferente de nook me muestre el contenido de este menu.

acceso.php


<?php
include('seguridad.php');
if (!$segur==nook)
{
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Mantenimiento del Administrador</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<div align="center">
<table width="270" border="1">
<tr>
<td width="260"><div align="center" ><strong>SELECCION OPCION</strong></div></td>
</tr>
</table>
<table width="253" border="1">
<tr bgcolor="#CC3300">
<th colspan="2" scope="col">>USUARIOS</th>
</tr>
<tr>
<td width="40" ><div align="center">1.1</div></td>
<td width="197"><div align="left"><a href="u_form_ingresar.php">Ingresar</a></div></td>
</tr>
<tr>
<td><div align="center">1.2</div></td>
<td><div align="left"><a href="u_consultar.php">Consultar</a></div></td>
</tr>
<tr>
<td><div align="center">1.3</div></td>
<td><div align="left"><a href="u_modificar.php">Modificar</a></div></td>
</tr>
<tr>
<td><div align="center">1.4</div></td>
<td><div align="left"><a href="u_eliminar.php">Eliminar</a></div></td>
</tr>
</table>
<table width="100" border="1" cellpadding="1" cellspacing="1" bgcolor="#ECE9D8">
<tr>
<th scope="col">Salir</th>
</tr>
</table>
</div>
<?php
include('pie_pagina.php');
}
?>

</body>
</html>

Esto lo hago para todas las pagina que quiero que se logueen.
Me parece que el problema esta en la variable que envio ($segur=nook;) de seguridad.php a acceso.php

Gracias y saludos