| Auteur |
Message |
Carte Mère
Messages: 609
Tutoriaux : 0
|
Posté le:
Sam 14 Jan 2006 12:06 Sujet : formulaire de connection |
  |
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 !  |
_________________
Allez faire un tour par ici : GrafikCreation.com, communauté graphique. Tutoriaux, Ressources, Aide et Conseils |
|
     |
 |
Vil Admin Méchant
Messages: 12043
Tutoriaux : 64
|
Posté le:
Sam 14 Jan 2006 13:53 Sujet : formulaire de connection |
  |
|
   |
 |
Carte Mère
Messages: 609
Tutoriaux : 0
|
Posté le:
Sam 14 Jan 2006 14:45 Sujet : formulaire de connection |
  |
| Pouzy a écrit: | | Quand on dit "avant tout code html", c'est aussi avant
le doctype ! |
c'est quoi le doctype ? |
|
|
     |
 |
Vil Admin Méchant
Messages: 12043
Tutoriaux : 64
|
Posté le:
Sam 14 Jan 2006 15:05 Sujet : formulaire de connection |
  |
Regarde la source d'aidoforum, tout en haut tu vois :
| Code: | <?xml
version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
Faut mettre tout ton truc de sessions avant ça ! C'ets vraiment la première chose à mettre sur ta
page ! |
|
|
   |
 |
AidoModo
AidoCodeur
Messages: 5179
Tutoriaux : 2
|
Posté le:
Sam 14 Jan 2006 16:20 Sujet : formulaire de connection |
  |
|
    |
 |
Carte Mère
Messages: 609
Tutoriaux : 0
|
Posté le:
Sam 14 Jan 2006 17:47 Sujet : formulaire de connection |
  |
oui, c'est tout en haut de ma page, il n'y a rien avant. |
|
|
     |
 |
AidoModo
AidoCodeur
Messages: 5179
Tutoriaux : 2
|
Posté le:
Sam 14 Jan 2006 19:51 Sujet : formulaire de connection |
  |
|
    |
 |
Carte Mère
Messages: 609
Tutoriaux : 0
|
Posté le:
Dim 15 Jan 2006 09:55 Sujet : formulaire de connection |
  |
voici le code entier de mon menu :
| Code: |
<table border="0" cellpadding="0" cellspacing="0"
width="200" valign="top"
background="http://www.grafikcreation.com/images/menu_fond.gif">
<tr height="30">
<td width="200" colspan="3" valign="top"
background="http://www.grafikcreation.com/images/menu_membres.gif"></td>
</tr>
<tr height="10">
<td width="200" colspan="3"></td>
</tr>
<tr>
<td width="20"></td>
<td width="180">
<table border="0" width="180">
<tr>
<td width="10"></td>
<td width="160" align="center">
<?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;
}
?>
</td>
<td width="10"></td>
</tr>
</table>
</td>
<td width="20"></td>
</tr>
<tr height="10">
<td width="200" colspan="3"></td>
</tr>
<tr height="30">
<td width="200" colspan="3"
background="http://www.grafikcreation.com/images/menu.gif"></td>
</tr>
<tr height="10">
<td width="200" colspan="3"></td>
</tr>
<tr>
<td width="20"></td>
<td width="180">
<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">Acceuil</a></td>
<td width="10"></td>
</tr>
<tr>
<td width="10"></td>
<td width="160"><a
href="http://www.grafikcreation.com/annuaire">Annuaire</a></td>
<td width="10"></td>
</tr>
<tr>
<td width="10"></td>
<td width="160"><a
href="http://www.grafikcreation.com/forum">Forum</a></td>
<td width="10"></td>
</tr>
<tr>
<td width="10"></td>
<td width="160"><a
href="http://www.grafikcreation.com/tutoriaux.php">Tutoriaux</a></td>
<td width="10"></td>
</tr>
<tr>
<td width="10"></td>
<td width="160"><a
href="http://www.grafikcreation.com/ressources.php">Ressources</a></td>
<td width="10"></td>
</tr>
<tr>
<td width="10"></td>
<td width="160"><a
href="http://www.grafikcreation.com/telecharger.php">Télécharger</a></td&g
t;
<td width="10"></td>
</tr>
<tr>
<td width="10"></td>
<td width="160"><a
href="http://www.grafikcreation.com/news.php">news</a></td>
<td width="10"></td>
</tr>
<tr>
<td width="10"></td>
<td width="160"><a
href="http://www.grafikcreation.com/nos_banniere.php">nos
bannières</a></td>
<td width="10"></td>
</tr>
<tr>
<td width="10"></td>
<td width="160"><a
href="http://www.grafikcreation.com/goodies.php">goodies</a></td>
<td width="10"></td>
</tr>
<tr>
<td width="10"></td>
<td width="160"><a
href="http://www.grafikcreation.com/partenaires.php">Partenaires</a></td&g
t;
<td width="10"></td>
</tr>
<tr>
<td width="10"></td>
<td width="160"><a
href="http://www.grafikcreation.com/contact.php">Contact</a></td>
<td width="10"></td>
</tr>
<tr height="10">
<td width="10"></td>
<td width="160"></td>
<td width="10"></td>
</tr>
</table>
</td>
<td width="20"></td>
</tr>
<tr height="10">
<td width="200" colspan="3"></td>
</tr>
<tr height="30">
<td width="200" colspan="3"
background="http://www.grafikcreation.com/images/menu_shoutbox.gif"></td>
</tr>
<tr height="10">
<td width="200" colspan="3"></td>
</tr>
<tr>
<td width="20"></td>
<td width="180">
<table border="0" width="180">
<tr>
<td width="10"></td>
<td width="160" align="center">
<?
mysql_connect("localhost", "cobix25_site", "xxxxxx"); //
Connexion à MySQL
mysql_select_db("cobix25_site"); // Sélection de la base
$sql = mysql_query ("SELECT * FROM shoutbox ORDER BY id DESC LIMIT 6");
while ($donnees = mysql_fetch_array($sql))
{
$chaine = $donnees['message'];
$pseudo = $donnees['pseudo'];
$sqs=mysql_query("SELECT * FROM smileys ORDER BY id ASC");
while($donnee=mysql_fetch_array($sqs))
{
$var1 = $donnee['html'];
$var2 = '<img src="'.$donnee['img'].'">';
$chaine = str_replace($var1,$var2,$chaine);
}
// On fait une boucle pour lister tout ce que contient la table :
?>
<p>
<font color=#FF0066><b><? echo $pseudo; ?> :
</b><br></font>
<? echo $chaine; ?><br>
</p>
<?
}
mysql_close(); // Déconnexion de MySQL
?>
<br>
<form action="shoutbox_confirm_post.php" method="post">
<div align="center"><p><b>Pseudo</b> :
</p></div><br><input type="text" name="pseudo"
size="15">
<div align="center"><p><b>Message</b> :
</p></div><br><input type="text" name="message"
size="15"><br><br>
<div align="center"><input type="submit" value="Envoyer"
class="bouton"></div></form>
</td>
<td width="10"></td>
</tr>
</table>
</td>
<td width="20"></td>
</tr>
<tr height="10">
<td width="200" colspan="3"></td>
</tr>
<tr height="30">
<td width="200" colspan="3"
background="http://www.grafikcreation.com/images/menu_part.gif"></td>
</tr>
<tr height="10">
<td width="200" colspan="3"></td>
</tr>
<tr>
<td width="20"></td>
<td width="180">
<table border="0" width="180">
<tr>
<td width="10"></td>
<td width="160" align="center"><a title="Annuaire
avec rapports d'indexation Google" href="http://annuaire.yagoort.org">Annuaire
Webmaster</a></td>
<td width="10"></td>
</tr>
<tr>
<td width="10"></td>
<td width="160" align="center"><a
href="http://www.wistee.fr/" title="Hébergement Mutualisé">Hébergement
Mutualisé</a></td>
<td width="10"></td>
</tr>
<tr>
<td width="10"></td>
<td width="160" align="center"><a
href="http://www.service-webmaster.fr/"
title="service-webmaster">Service-webmaster</a></td>
<td width="10"></td>
</tr>
</table>
</td>
<td width="20"></td>
</tr>
<tr height="10">
<td width="200" colspan="3"></td>
</tr>
<tr height="1">
<td width="200" colspan="3"
background="http://www.grafikcreation.com/images/menu_fond2.gif"></td>
</tr>
</table>
|
et celui d'une de mes pages :
| 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);
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_SITE);
init_userprefs($userdata);
//
// End session management
//
?>
<head>
<title>Grafikcreation.com - Contacter l'équipe de Grafikcreation</title>
<?
// on inclue les balises meta
include("/home/cobix25/domains/grafikcreation.com/public_html/meta.php");
?>
<link rel="StyleSheet" type="text/css"
href="http://www.grafikcreation.com/test/style.css">
</head>
<body>
<?
// on inclue l'header
include("/home/cobix25/domains/grafikcreation.com/public_html/test/header.php");
?>
<?
// on inclue le menu
include("/home/cobix25/domains/grafikcreation.com/public_html/test/menu.php");
?>
</td>
<td width="10"></td>
<td width="560" valign="top"><br>
<br>
<div align="center"><p>Si vous voulez nous contacter, veuillez remplir tout
les champs ci-dessous.</p><br>
<form method="POST"
action="http://www.grafikcreation.com/test/contact_envoy.php">
<p><b>Sujet :</b></p>
<input type="text" name="sujet" size="20">
<br><br><p><b>Message :</b></p>
<textarea rows="8" name="message"
cols="80"></textarea><br><br>
<input type="submit" value="Envoyer" class="bouton">
</form></div>
</td>
<td width="10"
background="http://www.grafikcreation.com/design/fond1.gif"></td>
<td width="10"></td>
</tr>
<?
// on inclue le bas
include("/home/cobix25/domains/grafikcreation.com/public_html/test/bas.php");
// on inclue le code pour la mesure d'audience
include("/home/cobix25/domains/grafikcreation.com/public_html/mesure.php");
?>
</body>
|
|
|
|
     |
 |
Carte Mère
Messages: 609
Tutoriaux : 0
|
Posté le:
Dim 15 Jan 2006 21:27 Sujet : formulaire de connection |
  |
savez-vous d'ou vient le problème ?  |
|
|
     |
 |
AidoModo
AidoCodeur
Messages: 5179
Tutoriaux : 2
|
Posté le:
Mar 17 Jan 2006 20:15 Sujet : formulaire de connection |
  |
| cobix25 a écrit: | ?>
<head> |
gné?
pas normal ça.....
c'est ou ça:
ou ça: (mais ça marchera pas)
| Code: | <html>
<?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);
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_SITE);
init_userprefs($userdata);
//
// End session management
//
?>
<head> |
|
|
|
    |
 |
|
|
|
|