Bonjour !
Je suis en train de faire un formulaire de connection pour la nouvelle version de mon site. Comme j'ai un forum phpbb, j'aurais aimé utiliser les sessions phpbb sur mon site comme sa, le visiteur n'a pas besoin de s'inscrir sur le forum et sur le site. J'ai donc trouvé un tutoriel sur phpbb-fr pour créer un formulaire en utilisant les sessions de phpbb. Mais le problème c'est que chez moi, il ne marche pas.
Je veux le placer dans la colone de gauche de mon site, pour cela, j'inclue le menu sur toutes mes page, et avant tout code html je met ce code :
Code
<?php
define('IN_PHPBB', true);
$phpbb_root_path = '/home/cobix25/domains/grafikcreation.com/public_html/forum/';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
$redirect_login = "login.$phpEx";
$redirect_logout = "login.$phpEx";
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_SITE);
init_userprefs($userdata);
//
// End session management
//
?>
Dans mon menu, je met ce code ci mais je suis obligé d'avoir du html avant :
Code
<?php
$logout = htmlspecialchars($HTTP_GET_VARS['logout']);
if ( $logout )
{
session_end($userdata['session_id'], $userdata['user_id']);
redirect(append_sid($redirect_logout));
}
$logue = '<table border="0" width="180">
<tr height="10">
<td width="10"></td>
<td width="160"></td>
<td width="10"></td>
</tr>
<tr>
<td width="10"></td>
<td width="160"><a href="http://www.grafikcreation.com/membres/index.php">Espace Membres</a></td>
<td width="10"></td>
</tr>
<tr>
<td width="10"></td>
<td width="160"><a href="http://www.grafikcreation.com/membres/">Ajouter une création dans le générateur</a></td>
<td width="10"></td>
</tr>
<tr>
<td width="10"></td>
<td width="160"><a href="http://www.grafikcreation.com/membres/">Ecrire un tutoriel</a></td>
<td width="10"></td>
</tr>
<tr>
<td width="10"></td>
<td width="160"><a href="' . append_sid("profil.$phpEx") . '">' . $lang['Profile'] . '</a></td>
<td width="10"></td>
</tr>
<tr>
<td width="10"></td>
<td width="160"><a href="?logout=true">' . $lang['Logout'] . ' [ ' . $userdata['username'] . ' ]</a></td>
<td width="10"></td>
</tr>
<tr height="10">
<td width="10"></td>
<td width="160"></td>
<td width="10"></td>
</tr>
</table>';
$non_logue = '<form action="' . $phpbb_root_path . 'login.php" method="post">
<div align="center"><p><b>Pseudo</b> : </p></div><br><input type="text" name="username">
<div align="center"><p><b>Message</b> : </p></div><br><input type="password" name="password"><br><br>
<input type="hidden" name="redirect" value="' . $adresse_site . append_sid($redirect_login) . '"><input class="bouton" type="submit" value="' . $lang['Login'] . '" name="login">
</form>';
if ( $userdata['session_logged_in'] )
{
echo $logue;
}
else
{
echo $non_logue;
}
?>
Le problème c'est que je ne peux ni me connecter ni me déconnecter a partir de ce formulaire. voici les messages d'erreur qui apparaissent :
Citation
Warning: Cannot modify header information - headers already sent by (output started at /home/cobix25/domains/grafikcreation.com/public_html/test/contact.php:19) in /home/cobix25/domains/grafikcreation.com/public_html/forum/includes/sessions.php on line 493
Warning: Cannot modify header information - headers already sent by (output started at /home/cobix25/domains/grafikcreation.com/public_html/test/contact.php:19) in /home/cobix25/domains/grafikcreation.com/public_html/forum/includes/sessions.php on line 494
Warning: Cannot modify header information - headers already sent by (output started at /home/cobix25/domains/grafikcreation.com/public_html/test/contact.php:19) in /home/cobix25/domains/grafikcreation.com/public_html/forum/includes/functions.php on line 843
Quelqu'un pourrait m'aider car je ne sais pas du tout quoi faire.
Merci ! 