Ante la posibilidad de poner mal el error, copio las partes de código que más pueden afectar a esto. Sólo me falto comentar, que al pinchar sobre los enlaces del menú, la barra de direcciones recoge bien la dirección, sin embargo, sigue mostrando el valor 'default'.
El index2.php
Código PHP:
<?php
if (!isset($_SESSION['usuario'])) {
session_start();
}
require_once ("content/adm_fns.php");
require_once ("content/usr_fns.php");
do_html_header ("Zona Privada - J. Briceño Asesores");
do_html_body ("content/switch2.php");
do_html_footer ();
?>
adm_fns.php
Código PHP:
<?php
require_once('content/db_fns.php');
require_once('content/site_adm_fns.php');
?>
site_adm_fns.php
Código PHP:
<?php
#=================================================
#
# V I S U A L E S
#
#=================================================
# Cabecera
function do_html_header ($title) {
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?php echo $title; ?></title>
<link href="estilos.css" rel="stylesheet" type="text/css" />
<link href="estilosadm.css" rel="stylesheet" type="text/css" />
<meta name="description" content="Sitio web de la aseosría ___" />
<meta name="keywords" lang="es" content="asesoria, fiscal, contable, contabilidad, laboral, mercantil, hacienda, impuestos, madrid, miraflores de la sierra, miraflores" />
<meta name="robot" content="index,follow">
<meta name="Author" content="">
<meta http-equiv=?Content-Type? content=?application/xhtml+xml; charset=UTF-8? />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /></head>
<?php
if ($title)
do_html_heading($title);
}
# Heading
function do_html_heading ($title) {
}
# Nombre Empresa
function n_empresa () {
echo "<span class='nombre'> </span>";
}
# Cuerpo
function do_html_body ($file_switch) {
?>
<body>
<div id="contenedor">
<div id="cabecera"><img src="img/logo-trans.png" /></div>
<div id="menu_ad">
<table id="ad_menu" align="center">
<tr>
<td valign="top"><?php do_adm_menu(); ?></td>
<td valign="top"><?php include ('adm/home2.php'); ?></td>
</tr>
</table>
</div>
<div id="cuerpo">
<div id="principal"><?php include($file_switch); ?></div>
<div id="relleno"> </div>
</div>
<?php
}
# Footer
function do_html_footer () {
?>
<div id="pie"><?php include_once("data/pie.html"); ?></div>
</div>
</body>
</html>
<?php
}
function do_adm_menu() {
if (isset ($_SESSION['usuario'])) {
include ('adm/menu_ad.php');
}else{
echo ' ';
}
}
#==============================================
#
# USUARIOS
#
#==============================================
#==============================================
#
# LOPD
#
#==============================================
# función contenedora de LOPD
function do_html_LOPD () {
?>
<h2>Acuerdo de ...</h2>
<?php
}
#=================================================
#
# L O G I N
#
#=================================================
# Formulario de acceso
// function usr_form () {
//
// if (!isset($_SESSION['usuario'])) {
// echo do_usr_access_form();
// }else{
// echo 'Bienvenido' .$_SESSION['usuario'];
// /*if ($_SESSION['nivel']==1) {
// #acceso a 'ficha de cliente'
// #echo "<br /><a href='index2.php?id=9'>Ficha de cliente</a>";
// }*/
// #acceso a 'logout
// echo "[<a href='index2.php?id=8'>salir</a>]";
// }
//}
function do_usr_access_form () {
#index2.php
?>
<form action='do_login.php' method='POST'>
<fieldset>
<legend>Acceso Usuarios</legend>
<label>usuario</label>
<input type='text' name='user' size='20' />
<label>contraseña</label>
<input type='password' name='pass' size='20' />
<br />
<br />
<input type='submit' value='acceder' />
</fieldset>
</form>
<?php
}
# Seguridad inyección
function addslashes__recursive($var){
if (!is_array($var))return addslashes($var);
$new_var = array();
foreach ($var as $k => $v){
$new_var[addslashes($k)] = addslashes__recursive($v);
}
return new_var;
}
$_POST = addslashes__recursive($_POST);
$_GET = addslashes__recursive($_GET);
$_REQUEST = addslashes__recursive($_REQUEST);
$_SERVER = addslashes__recursive($_SERVER);
$_COOKIE = addslashes__recursive($_COOKIE);
?>
home.php (valor 'default' del switch)
Código PHP:
<?php
$usr_cruce = $_SESSION['id'];
$usr_estado = $_SESSION['estado'];
$usr_nivel = $_SESSION['nivel'];
if ($usr_estado == 1 ) {
do_html_LOPD ();
}else{
echo 'inicio<br />';
echo 'el valor de $pag es '.$pag.'<br />';
echo $_GET['pag'].'<br />';
echo 'el valor de error_reporting es '.error_reporting(E_ALL);
}
?>
Bueno, espero que esto sirva de algo.
Saludos y muchas gracias.