COMO CREAR TEMPLATES CON PHP E INCLUDE
<?php
if(empty($sec))
{
include("presentacion.html");
}
else
{
if(file_exists($sec.".php"))
include($sec.".php");
elseif(file_exists($sec.".html"))
include($sec.".html");
else
echo 'Perdón pero la página solicitada no existe';
}
?>
<?php
if(empty($sec))
{
include("presentacion.html");
}
else
{
if(file_exists($sec.".php"))
include($sec.".php");
elseif(file_exists($sec.".html"))
include($sec.".html");
else
echo 'Perdón pero la página solicitada no existe';
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Plantilla en PHP</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3"><div align="right">Logotipo y Titulo</div></td>
</tr>
<tr>
<td width="20%"><p>Menu principal</p>
<ul>
<li><a href="?sec=1">Sección 1 </a></li>
<li><a href="?sec=2">Sección 2 </a></li>
<li><a href="?sec=3">Sección 3 </a></li>
</ul></td>
<td colspan="2" valign="top">
<?php
if(empty($sec))
{
include("presentacion.html");
}
else
{
if(file_exists($sec.".php"))
include($sec.".php");
elseif(file_exists($sec.".html"))
include($sec.".html");
else
echo 'Perdón pero la página solicitada no existe';
}
?>
</td>
</tr>
<tr>
<td colspan="3">Pie de página </td>
</tr>
</table>
</body>
</html>
https://desarrolloweb.com/articulos/2472.php
FECHA: AGOSTO 8 2017
No hay comentarios.:
Publicar un comentario