J'ai un site architecturé en pseudo - frame avec comme fichier en haut "entete.php", à gauche "menug.php" et à droite "menud.php"
ci - dessous mon fichier :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>qcmresto.com</title>
</head>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="10"><?php include('entete.php'); ?></td>
</tr>
<tr>
<td width="15%" rowspan="6" valign="top"><?php include('menug.php'); ?></td>
<td width="70%" colspan="8" rowspan="5" valign="top"><?php
// pages autorisées
// ----------------------------------------------------
$pageOK = array('pagep/qcm.php' => 'pagep/qcm.php',
'pagep/ressource.php' => 'pagep/ressource.php',
'inscription/inscription.php' => 'inscription/inscription.php',
'pagep/challenge.php' => 'pagep/challenge.php',
'pagep/profil.php' => 'pagep/profil.php',
'accueil.php' => 'accueil.php',
'journal.php' => 'journal.php',
'news.php' => 'news.php',
'contact.php' => 'contact.php');
// On teste que le paramètre d'url existe et qu'il est bien autorisé
// -----------------------------------------------------------------
if ( (isset($_GET['page'])) && (isset($pageOK[$_GET['page']])) ) {
include($pageOK[$_GET['page']]); // Nous appelons le contenu central de la page
} else {
include('accueil.php'); // Page par défaut
}
?>
</td>
<td width="15%" rowspan="6" valign="top"><?php include('menud.php'); ?></td>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
<td colspan="8"><?php include('piedpage.html'); ?></td>
</tr>
</table>
</body>
</html>
Dans une des pages autorisées il y a des headers. (c'est eux qui m'embêtent)Ci - dessous la page
<?php
//Partie 1. Laissez cette partie au sommet de la page. Avant les en-têtes.
header("Expires: " . gmdate("D, d M Y H:i:s") . "GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT");
header("Pragma: no-cache");
header("Cache-Control: no-cache, must-revalidate");
// Charger le fichier de configuration du quiz
include("config/quiz_connect.inc.php3");
include("config/config.inc.php3");
//Fin de la partie 1
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<TITLE>qQCMRESTO.COM</TITLE>
<meta name="keywords" content="">
<meta name="author" content="SK">
<meta name="description" content="">
<link rel="stylesheet" href="config/feuille_de_style.css">
</head>
<body>
<?php
//partie 2 a copier dans le corp de votre page
if ($fond=='uni'){
print "<body bgcolor=\"$couleur\">";
}
else {
print "<body background=\"$image\"";
}
print "<div align=\"center\">";
print "<h1>$titre</h1></div><br>";
//Si on veut toutes les questions sur une page :
if($mono=='ensemble'){
echo "<FORM name=\"formaffiche\" ACTION=\"pagep/fqcm/quiz.php3\" METHOD=\"POST\">";
}
//Si on veut 1 question par page :
elseif($mono=='mono'){
echo "<FORM name=\"formaffiche\" ACTION=\"quiz2.php3\" METHOD=\"POST\">";
}
//Si on veut jouer sans limites de questions :
else{
echo "<FORM name=\"formaffiche\" ACTION=\"quiz_maxi.php3\" METHOD=\"POST\">";
}
?>
<table width="75%" border="1" align="center">
<tr bgcolor="#CC99FF">
<td><b>Entrez votre nom/pseudo :</b></td>
<td><span align="center"><input type="text" name="Nom_visiteur" size="30"></span></td>
</tr>
<?php
//Si on veut envoyer un mail au participant, on lui demande son adresse :
if($mailparticip=='vrai'){
echo "<tr bgcolor=\"#CC99FF\">";
echo "<td><b>Entrez votre adresse électronique :</b></td>";
echo "<td><span align=\"center\"><input type=\"text\" name=\"Email_visiteur\" size=\"30\"></span></td>";
echo "</tr>";
}
//Si on a choisi de jouer avec les catégories, on les affiche :
if($categorie=='vrai'){
echo "<tr bgcolor=\"#CC99FF\">";
echo "<td><b>Choisissez votre catégorie de question :</b></td>";
echo "<td><span align=\"center\"><select name=\"catego\">";
// Choisir la catégorie de question
$sql="SELECT categorie FROM quiz_categorie ORDER BY categorie ";
$res=mysql_db_query($db, $sql);
while ($row = mysql_fetch_array($res,MYSQL_ASSOC)) {
reset ($row);
while (list($key, $elem) = each ($row)) {
$elem=htmlEntities($elem);
echo "<option value=\"$elem\">$elem</option>\n";
}
}
echo "</select>";
echo "</span></td>";
echo "</tr>";
}
?>
<tr bgcolor="#CC99FF">
<td colspan="2">
<div align="center">
<input type="hidden" name="depart" value="nx">
<input type="submit" name="submit" value="Envoyer">
</div>
</td>
</tr>
</table>
</form>
<?php
//Si le quiz est prévu pour afficher les meilleurs scores sur la première page, on les affiche :
if($score=='index'){
//Si on n'a pas mis 0 comme nombre maximum d'affichage, on affiche :
if($nbtop!='0'){
print "<div align=\"center\"><br><span class=\"comic14\">";
print "Voici la liste des $nbtop meilleurs scores : </span>";
$sql="SELECT nomvisiteur, reponsesjustes, categorie FROM quiz_visiteur ORDER BY reponsesjustes DESC LIMIT 0, $nbtop";
$result=mysql_db_query($db, $sql);
include("table_score.php3");
echo "</div>";
}
}
else{}
?>
</body>
</html>
Quand elle s'affiche, j'ai les messages suivants:
La ligne 9 correspond à un include mais même en l'éliminant il m'affiche les même erreurs pour le reste de la page. Pour que ça fonctionne il faut que j'efface tout le contenu de la page "menug.php".Warning: Cannot modify header information - headers already sent by (output started at /home4/s/sitweb-chr/www/menug.php:9) in /home4/s/sitweb-chr/www/pagep/fqcm/index.php3 on line 8
Warning: Cannot modify header information - headers already sent by (output started at /home4/s/sitweb-chr/www/menug.php:9) in /home4/s/sitweb-chr/www/pagep/fqcm/index.php3 on line 9
Warning: Cannot modify header information - headers already sent by (output started at /home4/s/sitweb-chr/www/menug.php:9) in /home4/s/sitweb-chr/www/pagep/fqcm/index.php3 on line 10
Warning: Cannot modify header information - headers already sent by (output started at /home4/s/sitweb-chr/www/menug.php:9) in /home4/s/sitweb-chr/www/pagep/fqcm/index.php3 on line 11
Y a t - il un moyen de contourner le problème des headers des lignes 8, 9, 10, 11 du la page index.php3 afin que mon menug puisse s'afficher?
Si quelqu'un à une solution, d'avance merci beaucoup.
