Ver Mensaje Individual
  #2 (permalink)  
Antiguo 06/02/2007, 18:10
Avatar de jaquez
jaquez
 
Fecha de Ingreso: noviembre-2006
Mensajes: 123
Antigüedad: 17 años, 5 meses
Puntos: 0
Re: Links via switch

cheka las facs http://www.forosdelweb.com/showthread.php?t=101546

el codigo es el siguiente
Código PHP:
<html>
<head>
<title>Web Modular</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<table width="100%" border="0" cellpadding="5">
  <tr> 
    <td colspan="2">Cabecera de nuestra Web</td>
  </tr>
  <tr> 
    <td><a href="index.php?id=1">Secci&oacute;n 1</a><br>
      <a href="index.php?id=2">Seccion 2 </a> </td>
    <td>
<?
$id
=$_GET['id'];

switch (
$id) {
   case 
1:
       include(
"pagina1.php");
       break;
   case 
2:
       include(
"pagina2.php");
       break;
   case 
3:
       include(
"pagina3.php");
       break;
   default:
       include(
"pagina_por_defecto.php"); 
// estado default .. nos determina el estado 
// "si no es ninguna opcion de las anteriores".

?>
    </td>
  </tr>
  <tr> 
    <td colspan="2">Pie de p&aacute;gina</td>
  </tr>
</table>
</body>
</html>