Página 1 de 1

Integracií?Â?í?Â?í?Â?í?Â?í?Â?í?Â?í?Â?í?³n del Login en mi web site.

Publicado: 17 Oct 2005, 19:23
por vertical
Hola,

He dispongo de un web site con diferentes secciones (Noticias, Descargas, Enlaces, ...). He decidido aí?Â?í?Â?í?Â?í?Â?í?Â?í?Â?í?Â?í?±adirle un foro. Para ello que mejor que utilizar phpBB.
Me gustaria poder extender el manejo que hace phpBB de los usuarios y las sesiones para utilizarlo en el resto de mi web. Buscando un poco por internet encontre el siguiente articulo: Login Integration (Sessions) - Knowledge Base (http://www.phpbb.com/kb/article.php?article_id=143). Siguiendo un poco las explicaciones del articulo ahora dispongo de lo siguiente:

-Estructura de los directorios:
www\index.php
www\phpBB2\index.php
www\phpBB2\common.php
www\phpBB2\...
...

donde www\index.php es la pí?Â?í?Â?í?Â?í?Â?í?Â?í?Â?í?Â?í?¡gina de inicio de mi web site y www\phpBB2\index.php es la pí?Â?í?Â?í?Â?í?Â?í?Â?í?Â?í?Â?í?¡gina de inicio del foro phpBB.

En el archivo www\index.php he puesto el siguiente cí?Â?í?Â?í?Â?í?Â?í?Â?í?Â?í?Â?í?³digo tal y como indica el artí?Â?í?Â?í?Â?í?Â?í?Â?í?Â?í?Â?í?­culo:

Código: Seleccionar todo

define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);

//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//
Al iniciar el web site me aparece el siguiente mensaje de error:
Warning: Cannot add header information - headers already sent by (output started at C:\FoxServ\www\web\index.php:9) in C:\FoxServ\www\web\phpBB2\includes\sessions.php on line 206

Warning: Cannot add header information - headers already sent by (output started at C:\FoxServ\www\web\index.php:9) in C:\FoxServ\www\web\phpBB2\includes\sessions.php on line 207
A que se debe esto???

Muchas gracias!!!!!

Re: Integracií?Â?í?Â?í?Â?í?Â?í?Â?í?Â?í?Â?í?³n del Login en mi web site.

Publicado: 17 Oct 2005, 23:26
por vertical
Hola,

Parece ser que he encotrado el error. Este articulo http://www.php.net/manual/en/function.header.php me ha dado un poco de luz sobre el tema.

El cí?Â?í?Â?í?Â?í?Â?í?Â?í?Â?í?Â?í?³digo:

Código: Seleccionar todo

define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);

//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//
debe ir al principio del archivo, antes de cualquier etiqueta HTML o cualquier linea en blanco:
Remember that header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP. It is a very common error to read code with include(), or require(), functions, or another file access function, and have spaces or empty lines that are output before header() is called. The same problem exists when using a single PHP/HTML file.
Que aquí?Â?í?Â?í?Â?í?Â?í?Â?í?Â?í?Â?í?­ quede esta info para la posteridad por si alguien se encuentra con el mismo problema...

P.D: esto ha sido un mono-thread... :lol: