Ver Mensaje Individual
  #4 (permalink)  
Antiguo 30/06/2012, 00:48
Avatar de Nemutagk
Nemutagk
Colaborador
 
Fecha de Ingreso: marzo-2004
Ubicación: México
Mensajes: 2.633
Antigüedad: 20 años, 1 mes
Puntos: 406
Respuesta: problemas con Include

Archivo que incluye la cabecera...
Código PHP:
Ver original
  1. $title = 'Página de inicio';
  2. include('cabecera.php');

archivo cabecera.php
Código PHP:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title><?php echo $title; ?></title>
  5. <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
  6. </head>
  7.  
  8. <body>
  9.  
  10. <div id="wrapper">
  11.  
  12. <div id="header">
  13. <div id="fondo1"><h1 id="logo"><a href="/" title="Homepage">casa</a></h1></div>
  14. <div id="fondo2"></div>
  15. </div><!-- #header-->

Pero tendrás que agregar la variable $title en todos los archivos que incluyas tu cabecera, si no, no se imprimirá ningún titulo...

PD: Cada vez que publiques código usa Highlight para poder leer de forma correcta y facil...
__________________
Listo?, tendría que tener 60 puntos menos de IQ para considerarme listo!!!
-- Sheldon Cooper
http://twitter.com/nemutagk
PD: No contestaré temas vía mensaje personal =)