![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
23/05/2011, 03:49
|
|
Respuesta: Abrir sub_enlace HTML:
<ul>
<li><a href="coyuntura.php?page=info§ion=ver">Enlace1 </a>
</li>
<?php AbrirEnlace(); ?>
<li><a href="coyuntura.php?page=info§ion=ver">Enlace2 </a>
</li>
<?php AbrirEnlace(); ?>
</ul> PHP:
function AbrirEnlace()
{
?>
<?php
if(isset($_GET['page']))
{
$page = $_GET['page'];
$section = "include";
if(isset($_GET['section']))
{
$section = $_GET['section'];
if(!strpos($page,"/") && !strpos($section,"/") &&
!strpos($page,".") && !strpos($section,"."))
{
$path = $section."/".$page.".php";
if(file_exists($path))
{
include($path);
}
}
}
}
?>
El archivo PHP forma parte de una librería php, desde cada enlace se hace una llamada para que despliegue. |