Achetez et vendez votre matériel multimédia d'occasion sur notre service de petites annonces informatiques gratuites

formulaire de connection

Forum informatique > Support & Utilisation > formulaire de connection

<<<1>>>

[Page 1 sur 1 - 10 messages]
Informations Messages

cobix25

Avatar de cobix25
614 messages
Carte Mère
Carte Mère

Lien direct Le 14 Janvier 2006 à 11h06

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.Fou
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 ! Clin d'oeil

 

Pouzy

Avatar de Pouzy
14155 messages
No-Life
No-Life
Administrateur
Administrateur

Lien direct Le 14 Janvier 2006 à 12h53

Quand on dit "avant tout code html", c'est aussi avant le doctype !

Devenez fan d'Aidoweb sur Facebook \o/ - N'oubliez pas de cliquer sur [Résolu] une fois votre problème réglé
 

cobix25

Avatar de cobix25
614 messages
Carte Mère
Carte Mère

Lien direct Le 14 Janvier 2006 à 13h45

Citation de Pouzy

Quand on dit "avant tout code html", c'est aussi avant le doctype !



c'est quoi le doctype ?

 

Pouzy

Avatar de Pouzy
14155 messages
No-Life
No-Life
Administrateur
Administrateur

Lien direct Le 14 Janvier 2006 à 14h05

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 !

Devenez fan d'Aidoweb sur Facebook \o/ - N'oubliez pas de cliquer sur [Résolu] une fois votre problème réglé
 

ju2cho7

Avatar de ju2cho7
7322 messages
No-Life
No-Life
AidoCodeur
AidoCodeur
Modérateur
Modérateur

Lien direct Le 14 Janvier 2006 à 15h20

c'est décidé,je fais un tuto,mon premier d'ailleursSourire

Nous ne fournissons pas d'aide par MP. ;)
 

cobix25

Avatar de cobix25
614 messages
Carte Mère
Carte Mère

Lien direct Le 14 Janvier 2006 à 16h47

oui, c'est tout en haut de ma page, il n'y a rien avant.

 

ju2cho7

Avatar de ju2cho7
7322 messages
No-Life
No-Life
AidoCodeur
AidoCodeur
Modérateur
Modérateur

Lien direct Le 14 Janvier 2006 à 18h51

fais voir ton code...

Nous ne fournissons pas d'aide par MP. ;)
 

cobix25

Avatar de cobix25
614 messages
Carte Mère
Carte Mère

Lien direct Le 15 Janvier 2006 à 08h55

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>
<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>
<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>

 

cobix25

Avatar de cobix25
614 messages
Carte Mère
Carte Mère

Lien direct Le 15 Janvier 2006 à 20h27

savez-vous d'ou vient le problème ? Confus

 

ju2cho7

Avatar de ju2cho7
7322 messages
No-Life
No-Life
AidoCodeur
AidoCodeur
Modérateur
Modérateur

Lien direct Le 17 Janvier 2006 à 19h15

Citation de cobix25

?>
<head>


Choqué gné?
pas normal ça.....
c'est ou ça:

Code

?>
<html>
<head>


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>

Nous ne fournissons pas d'aide par MP. ;)
 

<<<1>>>

[Page 1 sur 1 - 10 messages]

Forum informatique > Support & Utilisation > formulaire de connection