3.- si todo esta bien te deja apretar el enlace para irte al siguiente directorio. Los 2 archivos anteriores que he mostrado estan en el "root/". Ahora el link nos llevara a "root/sisprod/", este es justamente el directorio que no quiero que se pueda ingresar a ningun archivo que este dentro, sin que pase previamente por el login. Ahora estamos en "root/sisprod/index.php"
    
Código PHP:
Ver original- <?php include("head.php");  
- ?> 
- <body> 
- <?php include("nav.php"); ?> 
- <div class="cuerpo" id="cuerpo">     
-    <div class="contenido"> 
-     <div class="tabla_campos">    
-   
- <div style=" 
- background: #ffffff; /* Old browsers */ 
- background: -moz-linear-gradient(top,  #ffffff 0%, #e5e5e5 100%); /* FF3.6+ */ 
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#e5e5e5)); /* Chrome,Safari4+ */ 
- background: -webkit-linear-gradient(top,  #ffffff 0%,#e5e5e5 100%); /* Chrome10+,Safari5.1+ */ 
- background: -o-linear-gradient(top,  #ffffff 0%,#e5e5e5 100%); /* Opera 11.10+ */ 
- background: -ms-linear-gradient(top,  #ffffff 0%,#e5e5e5 100%); /* IE10+ */ 
- background: linear-gradient(to bottom,  #ffffff 0%,#e5e5e5 100%); /* W3C */ 
- filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#e5e5e5',GradientType=0 ); /* IE6-9 */ 
-   
- -moz-box-shadow:rgba(0, 0, 0, 0.682353) 0px 0px 14px 2px; 
- box-shadow:rgba(0, 0, 0, 0.682353) 0px 0px 14px 2px; 
- -webkit-border-radius:10px; 
- -moz-border-radius:10px; 
- width:auto; 
-   
- "> 
- <img style="margin:10px 0 10px 240px" src="img/logoxxx.png"> 
- </div> 
- </div> 
- </div> 
- </div> 
- </div> 
- </body> 
-   
- </html> 
4.- aca incluyo el archivo "header.php", que es donde se aloja session_start();    
Código PHP:
Ver original- <?php 
- ob_start(); // inner buffer to catch URL rewrites and other post processing  
- ?> 
- <!DOCTYPE html> 
- <html lang="en"> 
-     <head> 
-         <link href='http://fonts.googleapis.com/css?family=Droid+Sans' rel='stylesheet' type='text/css'> 
-         <meta charset="utf-8"> 
-         <title>Servicio de Contenedores xxx Ltda.</title> 
-         <link href="style.css" media="screen" rel="stylesheet" type="text/css" /> 
-         <link href="iconic.css" media="screen" rel="stylesheet" type="text/css" /> 
-         <script src="script/prefix-free.js"></script> 
-         <script src="script/jquery-1.6.1.js"></script> 
-          
-         <script type="text/javascript"> 
- $(document).ready(function() { 
-     $('input[type=checkbox]').live('click', function(){ 
-         var parent = $(this).parent().attr('id'); 
-         $('#'+parent+' input[type=checkbox]').removeAttr('checked'); 
-         $(this).attr('checked', 'checked'); 
-     }); 
- }); 
- </script> 
-   
- <script> 
- var no_digito = /\D/g; 
- </script> 
-   
- <script language="JavaScript">  
- <!--  
- var nav4 = window.Event ? true : false;  
- function acceptNum(evt){   
- // NOTE: Backspace = 8, Enter = 13, '0' = 48, '9' = 57   
- var key = nav4 ? evt.which : evt.keyCode;   
- return (key <= 13 || (key >= 48 && key <= 57) || key==46);  
- }  
- //-->  
- </script> 
-   
-   
-   
- <script type="text/javascript">  
- $(document).ready(function(){  
- $("#tra_dctos_detalle_div1 a").each(function(){  
- var href = $(this).attr("href");  
- $(this).attr({ href: "#"});  
- $(this).click(function(){  
- $("#tra_dctos_detalle_div2").load(href);  
- });  
- });  
- });  
- </script> 
-   
- <script> 
- function enviar_1(){ 
-   document.form_enviar1.submit() 
- } 
-   
- function enviar_2(){ 
-   document.form_enviar2.submit() 
- } 
- function enviar_3(){ 
-   document.form_enviar2.submit() 
- } 
- function enviar_4(){ 
-   document.form_enviar1.submit() 
- } 
-   
-   
-   
-   
- </script> 
-   
-   
- <script language="javascript"> 
-     function validar() 
-     { 
-         var ref1 = document.getElementById("a"); 
-         var ref2 = document.getElementById("b"); 
-         var ref3 = document.getElementById("c"); 
-         var ref4 = document.getElementById("ans");  
-      
-   
-         if(ref1.value>=0 && ref2.value>=0 && ref3.value>=0) 
-         { 
-            ref4.value = parseFloat(ref1.value) +  parseFloat(ref2.value) - parseFloat(ref3.value); 
-         } 
-     } 
- </script> 
-   
- <script type="text/javascript"> 
- $(document).ready(function() { 
-      
- $("#tooltip1").mouseover(function(){ 
- eleOffset = $(this).offset(); 
- $(this).next().fadeIn("fast").css({ 
- left: eleOffset.left + $(this).outerWidth(), 
- top: eleOffset.top 
- }); 
- }).mouseout(function(){ 
- $(this).next().hide(); 
- }); 
-   
- $("#tooltip2").mouseover(function(){ 
- eleOffset = $(this).offset(); 
- $(this).next().fadeIn("fast").css({ 
- left: eleOffset.left + $(this).outerWidth(), 
- top: eleOffset.top 
- }); 
- }).mouseout(function(){ 
- $(this).next().hide(); 
- }); 
-   
- });      
- </script> 
- <script>  
- function operar5() {  
- var d61 = parseInt(document.getElementById("tot61").value); 
- var d62 = parseInt(document.getElementById("tot62").value); 
- var d63 = parseInt(document.getElementById("tot63").value); 
- var d64 = parseInt(document.getElementById("tot64").value); 
- var d65 = parseInt(document.getElementById("tot65").value); 
- var d66 = parseInt(document.getElementById("tot66").value); 
- var d67 = parseInt(document.getElementById("tot67").value); 
- var d68 = parseInt(document.getElementById("tot68").value); 
- var d69 = parseInt(document.getElementById("tot69").value); 
- var d610 = parseInt(document.getElementById("tot610").value); 
- document.getElementById("tot63").value=d61*d62; 
- document.getElementById("tot65").value=d64-d63; 
- document.getElementById("tot68").value=d66*d67;  
- document.getElementById("tot610").value=d69-d68; 
- }  
- </script> 
-   
-   
-     </head> 
- <?php 
- if (!$conexion) { 
- ?> 
5.- y aca incluyo el archivo "nav.php" que es donde se comprueba siempre quien tiene la session iniciada (al final del codigo):    
Código PHP:
Ver original- <div class="wrap" id="menus"> 
-      
-     <nav> 
-         <ul class="menu"> 
-             <li><a href="index.php"><span class="iconic home"></span>Inicio</a></li> 
-             <li><a href=""><span class="iconic user"></span>Trabajadores</a> 
-                 <ul> 
-                     <li><a href="tra_fictra.php">Agregar / Modificar Ficha Trabajador</a></li> 
-                     <li><a href="tra_dctos.php">Descuentos Legales</a></li> 
-                     <li><a href="tra_otros_dctos.php">Otros Descuentos</a></li> 
-                     <li><a href="tra_preliq.php">Pre Liquidación</a></li> 
-                     
-                 </ul> 
-             </li> 
-             <li><a href="#"><span class="iconic new-window"></span>Categorías</a> 
-                 <ul> 
-                     <li><a href="cat_marca.php">Marcas contenedores</a></li> 
-                     <li><a href="cat_armador.php">Armadores</a></li> 
-                     <li><a href="cat_valortc.php">Valor Dolar</a></li> 
-                     <li><a href="cat_valorhh.php">Valor H/H por función</a></li> 
-                 </ul> 
-             </li> 
-             <li><a href="#"><span class="iconic bolt"></span> Produción</a> 
-                 <ul> 
-                     <li><a href="prod_nprod.php">Ingresar / Consultar Producción</a></li> 
-                     <li><a href="prod_asig_esp.php">Asignación Especial en CLP$</a></li> 
-                 </ul> 
-             </li> 
-             <li><a href="#"><span class="iconic magnifying-glass"></span>Busqueda</a> 
-                 <ul> 
-                     <li><a href="busq_1i.php">Todos los contenedores del número</a></li> 
-                      
-                     <li><a href="busq_2i.php">Todos los contenedores de la marca</a></li> 
-                     <li><a href="busq_3i.php">Todos los contenedores del armador</a></li> 
-                     <li><a href="busq_4i.php">Todos los otros descuentos pertenecientes a la categoría</a></li> 
-                     <li><a href="busq_5i.php">Todos los otros descuentosentre fechas</a></li> 
-                     <li><a href="busq_6i.php">Producción general entre fechas</a></li> 
-                 </ul> 
-             </li> 
-             <li><a href="#"><span class="iconic info"></span>Sobre el Software</a> 
-                 <ul> 
-                     <li><a href="sobre.php">Información</a></li> 
-                 </ul> 
-             </li> 
-         </ul> 
-         <div class="identif" align="right"> <?php 
- echo 'Bienvenido, '; 
- if (isset($_SESSION['k_username'])) { 
-     echo '<b>'.$_SESSION['k_username'].'</b>.'; 
-     echo '<p><a href="../logout.php">Cerrar Sesión</a></p>'; 
- } 
- ?></div> 
-         <div class="clearfix"></div> 
-     </nav> 
-     </div>