Ver Mensaje Individual
  #8 (permalink)  
Antiguo 02/05/2012, 13:27
Wainman
 
Fecha de Ingreso: abril-2012
Mensajes: 15
Antigüedad: 12 años
Puntos: 0
Respuesta: Verificar usuario en todas las paginas

Fijate que estas cerrando el codigo PHP antes de poner tu codigo y dejando abierto el { seguro te dara error.

Cita:
Iniciado por fermin3d Ver Mensaje
Me da un array(0) { }

estoy haciendo algo mal ?

sorry corregi
Código PHP:
Ver original
  1. <?php session_start();?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  6. <title>Auntentificacion</title>
  7. </head>
  8.  
  9. <body>
  10. <?php
  11. var_dump($_SESSION);
  12. if($_SESSION["autorizacion"]=="1")
  13.  
  14. {
  15. ?>
  16.  
  17. y aquí desplegamos el contenido para los usuarios autorizados. Una vez que terminemos de desplegar el contenido, al final de eso abrimos código nuevamente:
  18. <?php
  19.  
  20. }
  21.  
  22. else
  23.  
  24. {
  25.  
  26. echo "Usted no esta autorizado para ver este contenido. Por favor" ?> <a href="pagina-de-formulario.html"><?php echo "Identifiquese"?></a>.
  27.  
  28. <?php
  29. }
  30.  
  31. ?>
  32. </body>
  33. </html>