'.$modulo.'. No existe el archivo '.$conf[$modulo]['archivo'].''); ?> , repito en mi hosting banahosting si esta todo bien too correcto el problema esta cuando lo corro por wamp
Archivo index.php
Código PHP :
<?php
error_reporting(E_ALL);
include('conf.php');
if (!empty($_GET['id']))
$modulo = $_GET['id'];
else
$modulo = MODULO_DEFECTO;
if (empty($conf[$modulo]))
$modulo = MODULO_DEFECTO;
if (empty($conf[$modulo]['plantilla']))
$conf[$modulo]['plantilla'] = PLANTILLA_DEFECTO;
$path_plantilla = PLANTILLA_PATH.'/'.$conf[$modulo]['plantilla'];
$path_modulo = MODULO_PATH.'/'.$conf[$modulo]['archivo'];
if (file_exists($path_plantilla))
include( $path_plantilla );
else
if (file_exists( $path_modulo ))
include( $path_modulo );
else
die('Error al cargar el módulo <b>'.$modulo.'</b>. No existe el archivo <b>'.$conf[$modulo]['archivo'].'</b>');
?>
Archivo conf.php
Código PHP :
<?php
/*
* Archivo de configuración para nuestra aplicación modularizada.
* Definimos valores por defecto y datos para cada uno de nuestros módulos.
*/
define('MODULO_DEFECTO', 'inicio');
define('PLANTILLA_DEFECTO', 'plantilla.php');
define('MODULO_PATH', realpath('./modulos/'));
define('PLANTILLA_PATH', realpath('./plantillas/'));
$conf['inicio'] = array(
'archivo' => 'inicio.html',
'plantilla' => PLANTILLA_DEFECTO );
$conf['nosotros'] = array(
'archivo' => 'nosotros.html' );
$conf['contacto'] = array(
'archivo' => 'contacto.html' );
$conf['miembros'] = array(
'archivo' => 'miembros.html' );
$conf['servicios'] = array(
'archivo' => 'servicios.html' );
$conf['novedades'] = array(
'archivo' => 'novedades.html');
$conf['ofertas'] = array(
'archivo' => 'ofertas.html');
$conf['asistencia'] = array(
'archivo' => 'asistencia.html');
$conf['productos'] = array(
'archivo' => 'productos.html',
'plantilla' => 'plantillaxxx.php' );
/*
* Aquí seguiremos agregando tantas líneas de configuración "$conf[xxx]" como páginas tenga el sitio.
*/
$conf['imp_art'] = array(
'archivo' => $conf['inicio']['archivo'],
'plantilla' => 'imprimir.php' );
?>
Plantilla:
Código PHP :
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Web Modulares</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td height="28" valign="middle" bgcolor="#F1C07E">
<?php include('includes/menusuperior.html'); ?>
</td>
</tr>
<tr>
<td valign="top" bgcolor="#CC9900">
<?php include('includes/header.html'); ?>
</td>
</tr>
<tr>
<td valign="top" bgcolor="#CC9900"><img src="../imagenes/spacer.gif" width="1" height="5"></td>
</tr>
<tr>
<td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top">
<td bgcolor="#FEFCF5">
<div align="center">
<table width="92%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td valign="top">
<?
if (file_exists( $path_modulo )) include( $path_modulo );
else die('Error al cargar el módulo <b>'.$modulo.'</b>. No existe el archivo <b>'.$conf[$modulo]['archivo'].'</b>');
?>
</td>
</tr>
</table>
</div></td>
<td width="28%" bgcolor="#62C5CC">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top">
<td valign="middle" bgcolor="#62C5CC"><img src="../imagenes/spacer.gif" width="1" height="5"></td>
</tr>
<tr valign="top">
<td width="28%" bgcolor="#62C5CC">
<?php include('includes/menulateral.html'); ?> </td>
</tr>
<tr valign="top">
<td bgcolor="#62C5CC"> </td>
</tr>
</table>
</td>
</tr>
</table> </td>
</tr>
<tr>
<td valign="middle" bgcolor="#CC9900">
<p><img src="../imagenes/spacer.gif" width="1" height="2"></p></td>
</tr>
<tr>
<td height="30" valign="middle" bgcolor="#DCEDDC">
<?php include('includes/footer.html'); ?>
</td>
</tr>
<tr>
<td valign="top" bgcolor="#CC9900"><img src="../imagenes/spacer.gif" width="1" height="4"></td>
</tr>
</table>
</body>
</html>
Espero que un alma buena me ayude,
si es que fuese compatibilidad de versión de php , como se puede actualizar a la versión actual que trae wamp? cuales son las negativas de una versión antigua?
