Tengo una página index.php la cual me muestra las demás páginas de mi sitio dentro de la misma por medio de un código (que pongo más adelante). Si mando llamar páginas que contengan otro código php dentro de ellas este nunca se ejecuta.
Por ejemplo, la página index.php despliega dentro a seccion1.php y seccion1.php debe desplegar dentro a menu.htm con la funcion include. Si pruebo solo la pagina seccion1.php si puedo ver el contenido html y el menu.htm, pero cuando la despliego dentro de index.php no veo a menu.htm, solo el contenido html.
Aqui pongo el código de index.php y seccion1.php:
index.php
Código:
seccion1.php<!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> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <h1>Página principal</h1> <p><a href="index.php?seccion=secciones/seccion1.php">Seccion1</a> | Seccion2 | Seccion3</p> <?php if($_GET['seccion']){ readfile("$_GET[seccion]")or die("Pagina en construccion"); }else{ readfile("home.htm");} ?> </body> </html>
Código:
Soy novato en php, se muy poco pero espero con su ayuda aprender un poco más! Gracias de antemano!<!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> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <h2>Esta es la Seccion 1</h2> <?php include("menu.htm");?> </body> </html>
![sonrisota](http://static.forosdelweb.com/fdwtheme/images/smilies/xD.png)