Voilà mon pb :
Dans le livre d'or d'un site que nous avons développé, j'ai ceci qui apparait qd je poste un commentaire :
Warning: Cannot modify header information - headers already sent by (output started at /mnt/154/sda/0/3/laboiteachance/gsi/_debut.inc.php:37) in /mnt/154/sda/0/3/laboiteachance/gsi/creationCommentaire.php on line 45
Le commentaire est pourtant visible par la suite, ce serai une erreur de redirection...
Voilà le code :
- Code: Tout sélectionner
<?php
include("_debut.inc.php");
include("_gestionBase.inc.php");
include("_controlesEtGestionErreurs.inc.php");
include("_fonctionstests.inc.php");
// CONNEXION AU SERVEUR MYSQL PUIS SÉLECTION DE LA BASE DE DONNÉES festival
$connexion=connect();
if (!$connexion)
{
ajouterErreur("Echec de la connexion au serveur MySql");
afficherErreurs();
exit();
}
if (!selectBase($connexion))
{
ajouterErreur("La base de données festival est inexistante ou non accessible");
afficherErreurs();
exit();
}
// champs de saisi // action rappel page
$action=$_REQUEST['action'];
if ($action=='CreerCommentaire')
//initialisation des champs
{
$commentaire='';
$auteur='';
$date=date('d.m.Y');
}
else // On insère les données dans la table
{
$commentaire=$_REQUEST['commentaire'];
$auteur=$_REQUEST['auteur'];
$date=date('d.m.Y');
creercommentaire($connexion, $auteur, $commentaire, $date);
header('Location:listecommentaires.php'); //Redirection auto vers la liste des commentaires
}
// Affichage formullaire avec le champs caché action
echo "<form method='POST' action='creationCommentaire.php?'>
<input type='hidden' value='insererCommentaire' name='action'>
<table width='85%' cellspacing='0' cellpadding='0' align='center'
class='tabNonQuadrille'>
<tr class='enTeteTabNonQuad'>
<td colspan='3'>Livre d'or</td>
</tr>";
// Affichage date, auteur et commentaire dans le formulaire
echo '
<tr class="ligneTabNonQuad">
<td><b>Date :</b></td>
<td><i>'.$date.'</i></td>
</tr>
<tr class="ligneTabNonQuad">
<td><b>Auteur :</b></td>
<td><input type="text" value="'.$auteur.'" name="auteur" size="50"
maxlength="45"></td>
</tr>
<tr class="ligneTabNonQuad">
<td><b>Commentaire :</b></td>
<td><textarea type="text" name="commentaire" cols="66">'.$commentaire.'</textarea></td>
</tr>
<tr>
<td></td>
<td><input type="reset" value="Annuler"/> <input type="submit" value="Envoyer"/></td>
</tr>';
Le site : http://laboiteachance.free.fr/gsi/listecommentaires.php
Merci