Ver Mensaje Individual
  #26 (permalink)  
Antiguo 03/02/2012, 11:35
samaruc2k
 
Fecha de Ingreso: noviembre-2003
Ubicación: alicante
Mensajes: 44
Antigüedad: 20 años, 5 meses
Puntos: 2
Respuesta: Problemas con include_once

Te envío dos ficheros :
Uno Pruebas.php y el otro pagina_es.html
Si esto no te funciona, el problema no es el include, ya que esto es lo básico:
Pruebas.php
Código PHP:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>Documento sin título</title>
  6. </head>
  7.  
  8. <body>
  9.     esto es antes del include
  10. <?php
  11.     $lan="es";
  12.     include_once('pagina_'.$lan.'.html');
  13. ?>
  14.  
  15.     esto es despues del include
  16. </body>
  17. </html>

---------- Fin del pruebas.php

fichero para el include:
pagina_es.html
Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4. <title>esto es el include </title>
  5. </head>
  6.  
  7.  
  8. <p>esto es una prueba</p>
  9.  
  10. </body>
  11. </html>