Página 1 de 1

Problema en una página estática

Publicado: 27 Ene 2013, 23:39
por Hereze
Hola,

he creado una página estática siguiendo este procedimiento (lo he sacado de otra web, pero es el mismo que este http://www.phpbb-es.com/foro/guias-phpb ... 21671.html:

1. He creado un php con formato UTF-8 sin BOM que contiene lo siguiente:

Código: Seleccionar todo

        <?php
        define('IN_PHPBB', true);
        $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
        $phpEx = substr(strrchr(__FILE__, '.'), 1);
        include($phpbb_root_path . 'common.' . $phpEx);

        // Start session management
        $user->session_begin();
        $auth->acl($user->data);
        $user->setup();

        page_header('Hereze');

        $template->set_filenames(array(
            'body' => 'hereze.html',
        ));

        make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
        page_footer();
        ?>
2. A continuación, creo un html con este código de ejemplo:

Código: Seleccionar todo

        <!-- INCLUDE overall_header.html -->

        <h2>Mi Página</h2>

        <div class="panel">
           <div class="inner"><span class="corners-top"><span></span></span>

           <div class="content">
              <p>
                 TU CONTENIDO IRÍA AQUÍ. PUEDE SER TEXTO O CÓDIGO
              </p>
           </div>

           <span class="corners-bottom"><span></span></span></div>
        </div>

        <!-- INCLUDE jumpbox.html -->
        <!-- INCLUDE overall_footer.html -->
En el overall_header.html justo encima de esta linea:

Código: Seleccionar todo

<li class="icon-faq"><a href="{U_FAQ}" title="{L_FAQ_EXPLAIN}">{L_FAQ}</a></li>
he puesto lo siguiente:

Código: Seleccionar todo

<li class="icon-gallery"><a href="./hereze.php">Nombre</a></li>
Bien, el html lo he copiado en la carpeta template y el php en el root, así que se escribo: http://www.exiliadosfc.com/pruebas/foro/hereze.php pues entro en la página. Sin embargo, me salen estos problemas:

1. En Firefox, aparece este error:

Código: Seleccionar todo

[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4977: Cannot modify header information - headers already sent by (output started at [ROOT]/hereze.php:1)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4979: Cannot modify header information - headers already sent by (output started at [ROOT]/hereze.php:1)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4980: Cannot modify header information - headers already sent by (output started at [ROOT]/hereze.php:1)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4981: Cannot modify header information - headers already sent by (output started at [ROOT]/hereze.php:1)
Además, el css no funciona y el overall_footer se ve sin formato, el resto correcto, todo centrado y bien.

2. En Explorer, los errores son estos:

Código: Seleccionar todo

[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4977: Cannot modify header information - headers already sent by (output started at [ROOT]/hereze.php:1)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4979: Cannot modify header information - headers already sent by (output started at [ROOT]/hereze.php:1)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4980: Cannot modify header information - headers already sent by (output started at [ROOT]/hereze.php:1)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4981: Cannot modify header information - headers already sent by (output started at [ROOT]/hereze.php:1)
Y además, el formato tanto del footer como del header es correcto, pero todo sale movido a la izquierda, probando en los dos navegadores lo podéis ver.

Esas linea de error del function, sólo aparecen aquí y son estas (las del error son las que están entre y , obviamente en el function real no sale ni ni el , sólo lo he puesto yo aquí para que lo veais):

Código: Seleccionar todo

 //-- [-] MOD: phpBB3 Football ---------------------------------------------


	// application/xhtml+xml not used because of IE
	[b]header('Content-type: text/html; charset=UTF-8');[/b]

	[b]header('Cache-Control: private, no-cache="set-cookie"');[/b]
[b]	header('Expires: 0');
	header('Pragma: no-cache');[/b]

	if (!empty($user->data['is_bot']))
	{
		// Let reverse proxies know we detected a bot.
		header('X-PHPBB-IS-BOT: yes');
	}

	return;
}
¿Sabéis que puede ser? el functions.php está en UTF-8 sin BOM.

Saludos.

Re: Problema en una página estática  Tema Solucionado

Publicado: 28 Ene 2013, 02:08
por Alorse
Hay espacios en blanco antes de <?php por eso el problema, eliminalos y resuelto, es un tema bastante común, bastaba con poner el error en google o en la búsqueda y te da la solución de inmediato.

Re: Problema en una página estática

Publicado: 28 Ene 2013, 09:45
por Hereze
Alorse escribió:Hay espacios en blanco antes de <?php por eso el problema, eliminalos y resuelto, es un tema bastante común, bastaba con poner el error en google o en la búsqueda y te da la solución de inmediato.
OSTIA, sé que no tiene que haber espacios pero ni me había fijado, menuda idiotez madre mia, a veces el problema es tan simple que ni te fijas.
Ahora lo probaré pero tiene que ser eso.

Ya está, problema resuelto.

Gracias.